From 5450bdeae9d4612ce102a749b5938991ef661caa Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 25 Jun 2025 10:34:03 +0300 Subject: [PATCH] feat(book/table): hide no children warning --- apps/client/src/widgets/type_widgets/book.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/client/src/widgets/type_widgets/book.ts b/apps/client/src/widgets/type_widgets/book.ts index 9b11129bb..66d476464 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">) {