Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(nbstore): leave awareness when destroy (#10394)

EYHNa59e6404234a
diff --git a/packages/common/nbstore/src/frontend/awareness.ts b/packages/common/nbstore/src/frontend/awareness.ts
index 6b0f22bee8..0badfa2991 100644
--- a/packages/common/nbstore/src/frontend/awareness.ts
+++ b/packages/common/nbstore/src/frontend/awareness.ts
@@ -61,6 +61,11 @@ export class AwarenessFrontend {
handleSyncCollect
);
+ awareness.once('destroy', () => {
+ awareness.off('update', handleAwarenessUpdate);
+ unsubscribe();
+ });
+
return () => {
awareness.off('update', handleAwarenessUpdate);
unsubscribe();