mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 03:33:06 +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);
|
ws = new WebsocketProvider('/', room, doc);
|
||||||
this._wsMap.set(room, ws);
|
this._wsMap.set(room, ws);
|
||||||
}
|
}
|
||||||
|
// close all websocket links
|
||||||
|
Array.from(this._wsMap.entries()).forEach(([id, ws]) => {
|
||||||
|
if (id !== room) {
|
||||||
|
ws.disconnect();
|
||||||
|
}
|
||||||
|
});
|
||||||
ws.connect();
|
ws.connect();
|
||||||
await new Promise<void>((resolve, reject) => {
|
await new Promise<void>((resolve, reject) => {
|
||||||
// TODO: synced will also be triggered on reconnection after losing sync
|
// TODO: synced will also be triggered on reconnection after losing sync
|
||||||
|
|||||||
Reference in New Issue
Block a user