fix(nbstore): fix cloud awareness (#10320)

This commit is contained in:
EYHN
2025-02-21 11:11:10 +08:00
committed by GitHub
parent 0ff7c5f897
commit 618042812b
2 changed files with 28 additions and 28 deletions

View File

@@ -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();