Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(book/table): hide no children warning
Elian Doran5450bdeae9d4
diff --git a/apps/client/src/widgets/type_widgets/book.ts b/apps/client/src/widgets/type_widgets/book.tsindex 9b11129bb1..66d4764644 100644--- a/apps/client/src/widgets/type_widgets/book.ts+++ b/apps/client/src/widgets/type_widgets/book.ts@@ -36,7 +36,21 @@ export default class BookTypeWidget extends TypeWidget {}async doRefresh(note: FNote) {- this.$helpNoChildren.toggle(!this.note?.hasChildren() && this.note?.getAttributeValue("label", "viewType") !== "calendar");+ this.$helpNoChildren.toggle(this.shouldDisplayNoChildrenWarning());+ }++ shouldDisplayNoChildrenWarning() {+ if (this.note?.hasChildren()) {+ return false;+ }++ switch (this.note?.getAttributeValue("label", "viewType")) {+ case "calendar":+ case "table":+ return false;+ default:+ return true;+ }}entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {