소스 검색

fix: emit scene init event after reconnecting

Arnošt Pleskot 2 년 전
부모
커밋
aa91af8f7d
2개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
  1. 7 5
      src/excalidraw-app/collab/Collab.tsx
  2. 1 1
      src/excalidraw-app/index.tsx

+ 7 - 5
src/excalidraw-app/collab/Collab.tsx

@@ -335,11 +335,13 @@ class Collab extends PureComponent<Props, CollabState> {
       this.reportActive();
       this.portal.socket.connect();
       this.portal.socketInitialized = true;
-      this.setIsCollaborationPaused(false);
-
-      if (callback) {
-        callback();
-      }
+      this.portal.socket.emit(WS_SCENE_EVENT_TYPES.INIT);
+      this.portal.socket.once("client-broadcast", () => {
+        this.setIsCollaborationPaused(false);
+        if (callback) {
+          callback();
+        }
+      });
     }
   };
 

+ 1 - 1
src/excalidraw-app/index.tsx

@@ -497,7 +497,7 @@ const ExcalidrawWrapper = () => {
           case !document.hidden && collabAPI.isPaused():
             excalidrawAPI.setToast({
               message: t("toast.reconnectRoomServer"),
-              duration: 100000,
+              duration: Infinity,
               closable: true,
             });