mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
fix(core): correctly toggle visibility of starter-bar based on doc.isEmpty (#10439)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Container, type ServiceProvider } from '@blocksuite/global/di';
|
||||
import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
|
||||
import { type Disposable, Slot } from '@blocksuite/global/utils';
|
||||
import { signal } from '@preact/signals-core';
|
||||
import { computed, signal } from '@preact/signals-core';
|
||||
|
||||
import type { ExtensionType } from '../../extension/extension.js';
|
||||
import { StoreSelectionExtension } from '../../extension/index.js';
|
||||
@@ -55,6 +55,10 @@ export class Store {
|
||||
|
||||
private readonly _readonly = signal(false);
|
||||
|
||||
private readonly _isEmpty = computed(() => {
|
||||
return this.root?.isEmpty() ?? true;
|
||||
});
|
||||
|
||||
private readonly _schema: Schema;
|
||||
|
||||
readonly slots: Doc['slots'] & {
|
||||
@@ -215,7 +219,11 @@ export class Store {
|
||||
}
|
||||
|
||||
get isEmpty() {
|
||||
return this.root?.isEmpty() ?? true;
|
||||
return this._isEmpty.peek();
|
||||
}
|
||||
|
||||
get isEmpty$() {
|
||||
return this._isEmpty;
|
||||
}
|
||||
|
||||
get loaded() {
|
||||
|
||||
Reference in New Issue
Block a user