Skip to content

Commit

Permalink
fix when calculating last broadcasted version
Browse files Browse the repository at this point in the history
  • Loading branch information
hero101 committed Oct 18, 2024
1 parent 6beb329 commit 01b668c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/domain/common/whiteboard/excalidraw/collab/Collab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,7 @@ class Collab {
const elements = this.excalidrawAPI.getSceneElementsIncludingDeleted();
const files = await this.filesManager.getUploadedFiles(this.excalidrawAPI.getFiles());
this.portal.broadcastScene(WS_SCENE_EVENT_TYPES.SCENE_UPDATE, elements, files, { syncAll: true });
const currentVersion = this.lastBroadcastedOrReceivedSceneVersion;
const candidateVersion = hashElementsVersion(this.getSceneElementsIncludingDeleted());
this.lastBroadcastedOrReceivedSceneVersion = Math.max(currentVersion, candidateVersion);
this.lastBroadcastedOrReceivedSceneVersion = hashElementsVersion(this.getSceneElementsIncludingDeleted());
}, SYNC_FULL_SCENE_INTERVAL_MS);
}

Expand Down

0 comments on commit 01b668c

Please sign in to comment.