Skip to content

Build your personal knowledge base with Trilium Notes

fix(collections): children warning stuck when changing view mode

Elian Dorand1d1d05ce7da
diff --git a/apps/client/src/widgets/type_widgets/Book.tsx b/apps/client/src/widgets/type_widgets/Book.tsx
index b1ed94d68f..6b796f6b6f 100644
--- a/apps/client/src/widgets/type_widgets/Book.tsx
+++ b/apps/client/src/widgets/type_widgets/Book.tsx
@@ -16,7 +16,7 @@ export default function Book({ note }: TypeWidgetProps) {
setShouldDisplayNoChildrenWarning(!note.hasChildren() && VIEW_TYPES.includes(viewType ?? ""));
}
- useEffect(refresh, [ note ]);
+ useEffect(refresh, [ note, viewType ]);
useTriliumEvent("entitiesReloaded", ({ loadResults }) => {
if (loadResults.getBranchRows().some(branchRow => branchRow.parentNoteId === note.noteId)) {
refresh();