mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix(core): fix meta.xxx is undefined (#6321)
This commit is contained in:
@@ -316,7 +316,7 @@ const ConflictList = ({
|
||||
setTrashModal({
|
||||
open: true,
|
||||
pageIds: [pageRecord.id],
|
||||
pageTitles: [pageRecord.meta$.value.title],
|
||||
pageTitles: [pageRecord.title$.value],
|
||||
});
|
||||
},
|
||||
[setTrashModal]
|
||||
|
||||
@@ -50,7 +50,7 @@ export class Tag {
|
||||
return;
|
||||
}
|
||||
pageRecord?.setMeta({
|
||||
tags: [...pageRecord.meta$.value.tags, this.id],
|
||||
tags: [...(pageRecord.meta$.value.tags ?? []), this.id],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -60,14 +60,14 @@ export class Tag {
|
||||
return;
|
||||
}
|
||||
pageRecord?.setMeta({
|
||||
tags: pageRecord.meta$.value.tags.filter(tagId => tagId !== this.id),
|
||||
tags: pageRecord.meta$.value.tags?.filter(tagId => tagId !== this.id),
|
||||
});
|
||||
}
|
||||
|
||||
readonly pageIds$ = LiveData.computed(get => {
|
||||
const pages = get(this.pageRecordList.records$);
|
||||
return pages
|
||||
.filter(page => get(page.meta$).tags.includes(this.id))
|
||||
.filter(page => get(page.meta$).tags?.includes(this.id))
|
||||
.map(page => page.id);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export class TagService {
|
||||
if (!pageRecord) return [];
|
||||
const tagIds = get(pageRecord.meta$).tags;
|
||||
|
||||
return get(this.tags$).filter(tag => tagIds.includes(tag.id));
|
||||
return get(this.tags$).filter(tag => (tagIds ?? []).includes(tag.id));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user