mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
refactor(editor): refactor page note empty checker (#9570)
Close [BS-2320](https://linear.app/affine-design/issue/BS-2320/内容为空的状态判断)
This commit is contained in:
@@ -70,9 +70,9 @@ export class BlockModel<
|
||||
|
||||
id!: string;
|
||||
|
||||
isEmpty = computed(() => {
|
||||
return this._children.value.length === 0;
|
||||
});
|
||||
isEmpty() {
|
||||
return this.children.length === 0;
|
||||
}
|
||||
|
||||
keys!: string[];
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ export class Blocks {
|
||||
}
|
||||
|
||||
get isEmpty() {
|
||||
return Object.values(this._blocks.peek()).length === 0;
|
||||
return this.root?.isEmpty() ?? true;
|
||||
}
|
||||
|
||||
get loaded() {
|
||||
|
||||
Reference in New Issue
Block a user