From 00ae455873f1d29aea75cf1c1d4dfb61471d074b Mon Sep 17 00:00:00 2001 From: Omar Brikaa Date: Wed, 24 Sep 2025 01:18:41 +0300 Subject: [PATCH] fix: Remove local elements when there is room data during `startCollaboration` (#9786) * Remove local elements when there is room data * Update excalidraw-app/collab/Collab.tsx --------- Co-authored-by: David Luzar <5153846+dwelle@users.noreply.github.com> --- excalidraw-app/collab/Collab.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/excalidraw-app/collab/Collab.tsx b/excalidraw-app/collab/Collab.tsx index bed130e24a..3c7e686d38 100644 --- a/excalidraw-app/collab/Collab.tsx +++ b/excalidraw-app/collab/Collab.tsx @@ -530,7 +530,10 @@ class Collab extends PureComponent { return null; } - if (!existingRoomLinkData) { + if (existingRoomLinkData) { + // when joining existing room, don't merge it with current scene data + this.excalidrawAPI.resetScene(); + } else { const elements = this.excalidrawAPI.getSceneElements().map((element) => { if (isImageElement(element) && element.status === "saved") { return newElementWith(element, { status: "pending" });