mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 18:26:05 +08:00
refactor(editor): use selected signal in block component (#9849)
This commit is contained in:
@@ -266,11 +266,9 @@ export class SelectionController implements ReactiveController {
|
||||
}
|
||||
selected$ = computed(() => this.getSelected());
|
||||
getSelected(): TableSelectionData | undefined {
|
||||
const selected = this.host.selected;
|
||||
|
||||
if (selected instanceof TableSelection) {
|
||||
return selected.data;
|
||||
}
|
||||
return undefined;
|
||||
const selection = this.host.selection.value.find(
|
||||
selection => selection.blockId === this.host.model.id
|
||||
);
|
||||
return selection?.is(TableSelection) ? selection.data : undefined;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user