mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(nbstore): fix cloud awareness (#10320)
This commit is contained in:
@@ -78,22 +78,6 @@ export class CloudAwarenessStorage extends AwarenessStorageBase {
|
||||
});
|
||||
};
|
||||
|
||||
if (this.connection.status === 'connected') {
|
||||
joinAndCollect().catch(err =>
|
||||
console.error('awareness join failed', err)
|
||||
);
|
||||
}
|
||||
|
||||
const unsubscribeConnectionStatusChanged = this.connection.onStatusChanged(
|
||||
status => {
|
||||
if (status === 'connected') {
|
||||
joinAndCollect().catch(err =>
|
||||
console.error('awareness join failed', err)
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const handleCollectAwareness = ({
|
||||
spaceId,
|
||||
spaceType,
|
||||
@@ -146,6 +130,22 @@ export class CloudAwarenessStorage extends AwarenessStorageBase {
|
||||
}
|
||||
};
|
||||
|
||||
if (this.connection.status === 'connected') {
|
||||
joinAndCollect().catch(err =>
|
||||
console.error('awareness join failed', err)
|
||||
);
|
||||
}
|
||||
|
||||
const unsubscribeConnectionStatusChanged = this.connection.onStatusChanged(
|
||||
status => {
|
||||
if (status === 'connected') {
|
||||
joinAndCollect().catch(err =>
|
||||
console.error('awareness join failed', err)
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return () => {
|
||||
leave();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user