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>
This commit is contained in:
Omar Brikaa
2025-09-24 01:18:41 +03:00
committed by GitHub
parent 06c5ea94d3
commit 00ae455873

View File

@@ -530,7 +530,10 @@ class Collab extends PureComponent<CollabProps, CollabState> {
return null; 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) => { const elements = this.excalidrawAPI.getSceneElements().map((element) => {
if (isImageElement(element) && element.status === "saved") { if (isImageElement(element) && element.status === "saved") {
return newElementWith(element, { status: "pending" }); return newElementWith(element, { status: "pending" });