mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-20 07:49:59 +02:00
Chunking incoming WS messages
This commit is contained in:
@@ -90,7 +90,7 @@ import type {
|
||||
} from "../../packages/excalidraw/data/reconcile";
|
||||
import { SyncClient } from "../../packages/excalidraw/sync/client";
|
||||
|
||||
export const syncAPIAtom = atom<SyncClient | null>(null);
|
||||
export const syncApiAtom = atom<SyncClient | null>(null);
|
||||
export const collabAPIAtom = atom<CollabAPI | null>(null);
|
||||
export const isCollaboratingAtom = atom(false);
|
||||
export const isOfflineAtom = atom(false);
|
||||
@@ -239,7 +239,7 @@ class Collab extends PureComponent<CollabProps, CollabState> {
|
||||
|
||||
SyncClient.create(this.excalidrawAPI, SyncIndexedDBAdapter).then(
|
||||
(syncAPI) => {
|
||||
appJotaiStore.set(syncAPIAtom, syncAPI);
|
||||
appJotaiStore.set(syncApiAtom, syncAPI);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -276,6 +276,8 @@ class Collab extends PureComponent<CollabProps, CollabState> {
|
||||
window.clearTimeout(this.idleTimeoutId);
|
||||
this.idleTimeoutId = null;
|
||||
}
|
||||
|
||||
appJotaiStore.get(syncApiAtom)?.disconnect();
|
||||
this.onUmmount?.();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user