mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
refactor(editor): set readonly (#9475)
This commit is contained in:
@@ -75,7 +75,7 @@ export class SelectionManager extends LifeCycleWatcher {
|
||||
|
||||
constructor(std: BlockStdScope) {
|
||||
super(std);
|
||||
this._id = `${this.std.doc.blockCollection.id}:${nanoid()}`;
|
||||
this._id = `${this.std.doc.id}:${nanoid()}`;
|
||||
this._setupDefaultSelections();
|
||||
this._store.awareness.on(
|
||||
'change',
|
||||
@@ -99,9 +99,7 @@ export class SelectionManager extends LifeCycleWatcher {
|
||||
if (id === this._store.awareness.clientID) return;
|
||||
// selection id starts with the same block collection id from others clients would be considered as remote selections
|
||||
const selection = Object.entries(state.selectionV2)
|
||||
.filter(([key]) =>
|
||||
key.startsWith(this.std.doc.blockCollection.id)
|
||||
)
|
||||
.filter(([key]) => key.startsWith(this.std.doc.id))
|
||||
.flatMap(([_, selection]) => selection);
|
||||
|
||||
const selections = selection
|
||||
|
||||
Reference in New Issue
Block a user