fix(core): fix meta.xxx is undefined (#6321)

This commit is contained in:
EYHN
2024-03-26 08:53:14 +00:00
parent b6bba523ff
commit 16063340d0
6 changed files with 11 additions and 11 deletions

View File

@@ -14,7 +14,7 @@ export class PageRecord {
private readonly localState: WorkspaceLocalState
) {}
meta$ = LiveData.from<DocMeta>(
meta$ = LiveData.from<Partial<DocMeta>>(
new Observable<DocMeta>(subscriber => {
const emit = () => {
const meta = this.workspace.docCollection.meta.docMetas.find(
@@ -60,5 +60,5 @@ export class PageRecord {
return this.mode$.value;
}
title$ = this.meta$.map(meta => meta.title);
title$ = this.meta$.map(meta => meta.title ?? '');
}