mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-21 16:26:58 +08:00
Merge remote-tracking branch 'origin/feat/cloud-sync-saika' into feat/cloud-sync-saika
This commit is contained in:
@@ -74,6 +74,12 @@ export class AffineProvider extends BaseProvider {
|
||||
ws = new WebsocketProvider('/', room, doc);
|
||||
this._wsMap.set(room, ws);
|
||||
}
|
||||
// close all websocket links
|
||||
Array.from(this._wsMap.entries()).forEach(([id, ws]) => {
|
||||
if (id !== room) {
|
||||
ws.disconnect();
|
||||
}
|
||||
});
|
||||
ws.connect();
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
// TODO: synced will also be triggered on reconnection after losing sync
|
||||
|
||||
Reference in New Issue
Block a user