mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-19 07:20:21 +02:00
WIP sync client
This commit is contained in:
@@ -88,7 +88,9 @@ import type {
|
||||
ReconciledExcalidrawElement,
|
||||
RemoteExcalidrawElement,
|
||||
} from "../../packages/excalidraw/data/reconcile";
|
||||
import { ExcalidrawSyncClient } from "../../packages/excalidraw/sync/client";
|
||||
|
||||
export const syncAPIAtom = atom<ExcalidrawSyncClient | null>(null);
|
||||
export const collabAPIAtom = atom<CollabAPI | null>(null);
|
||||
export const isCollaboratingAtom = atom(false);
|
||||
export const isOfflineAtom = atom(false);
|
||||
@@ -234,6 +236,10 @@ class Collab extends PureComponent<CollabProps, CollabState> {
|
||||
};
|
||||
|
||||
appJotaiStore.set(collabAPIAtom, collabAPI);
|
||||
appJotaiStore.set(
|
||||
syncAPIAtom,
|
||||
new ExcalidrawSyncClient(this.excalidrawAPI),
|
||||
);
|
||||
|
||||
if (import.meta.env.MODE === ENV.TEST || import.meta.env.DEV) {
|
||||
window.collab = window.collab || ({} as Window["collab"]);
|
||||
|
Reference in New Issue
Block a user