mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
fix: 🐛 fix crash when no calendarRoot
This commit is contained in:
parent
a4f59030e3
commit
f346c40b7c
@ -213,6 +213,10 @@ export default class CalendarWidget extends RightDropdownButtonWidget {
|
||||
|
||||
private async getWeekNoteEnable() {
|
||||
const noteId = await server.get<string[]>(`search/${encodeURIComponent('#calendarRoot')}`);
|
||||
if (noteId.length === 0) {
|
||||
this.weekNoteEnable = false;
|
||||
return;
|
||||
}
|
||||
const noteAttributes = await server.get<BAttribute[]>(`notes/${noteId}/attributes`);
|
||||
|
||||
for (const attribute of noteAttributes) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user