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

This commit is contained in:
Elian Doran 2025-11-18 08:39:58 +02:00
parent c62a03c97b
commit d1d1d05ce7
No known key found for this signature in database

View File

@ -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();