feat(views/board): display even if no children

This commit is contained in:
Elian Doran 2025-07-21 15:01:55 +03:00
parent 8b6826ffa4
commit ec021be16c
No known key found for this signature in database
2 changed files with 7 additions and 7 deletions

View File

@ -325,8 +325,9 @@ class NoteContext extends Component implements EventListener<"entitiesReloaded">
return false;
}
// Some book types must always display a note list, even if no children.
if (["calendar", "table", "geoMap"].includes(note.getLabelValue("viewType") ?? "")) {
// Collections must always display a note list, even if no children.
const viewType = note.getLabelValue("viewType") ?? "grid";
if (!["list", "grid"].includes(viewType)) {
return true;
}

View File

@ -45,12 +45,11 @@ export default class BookTypeWidget extends TypeWidget {
}
switch (this.note?.getAttributeValue("label", "viewType")) {
case "calendar":
case "table":
case "geoMap":
return false;
default:
case "list":
case "grid":
return true;
default:
return false;
}
}