mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat(core): awareness change event instead of update event (#10649)
This commit is contained in:
@@ -40,7 +40,7 @@ export class AwarenessFrontend {
|
||||
});
|
||||
};
|
||||
|
||||
awareness.on('update', handleAwarenessUpdate);
|
||||
awareness.on('change', handleAwarenessUpdate);
|
||||
const handleSyncUpdate = (update: AwarenessRecord, origin?: string) => {
|
||||
if (origin === uniqueId) {
|
||||
// skip self update
|
||||
@@ -62,12 +62,12 @@ export class AwarenessFrontend {
|
||||
);
|
||||
|
||||
awareness.once('destroy', () => {
|
||||
awareness.off('update', handleAwarenessUpdate);
|
||||
awareness.off('change', handleAwarenessUpdate);
|
||||
unsubscribe();
|
||||
});
|
||||
|
||||
return () => {
|
||||
awareness.off('update', handleAwarenessUpdate);
|
||||
awareness.off('change', handleAwarenessUpdate);
|
||||
unsubscribe();
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user