mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
fix(editor): clear remote selection when editor is deactive (#11450)
Closes: BS-3022
This commit is contained in:
@@ -162,6 +162,13 @@ export class StoreSelectionExtension extends StoreExtension {
|
||||
this.set([...current, ...selections]);
|
||||
}
|
||||
|
||||
// This method is used to clear **current editor's remote selections**
|
||||
// When the editor is not active, the remote selections should be cleared
|
||||
// So other editors won't see the remote selections from this editor
|
||||
clearRemote() {
|
||||
this.store.awarenessStore.setLocalSelection(this._id, []);
|
||||
}
|
||||
|
||||
update(fn: (currentSelections: BaseSelection[]) => BaseSelection[]) {
|
||||
const selections = fn(this.value);
|
||||
this.set(selections);
|
||||
|
||||
Reference in New Issue
Block a user