Skip to content

Build your personal knowledge base with Trilium Notes

fix(client/collections): collections not visible after viewing attachments

Elian Doran0a3e788d2176
diff --git a/apps/client/src/widgets/collections/NoteList.tsx b/apps/client/src/widgets/collections/NoteList.tsx
index 1081cd6dfd..af5157fdad 100644
--- a/apps/client/src/widgets/collections/NoteList.tsx
+++ b/apps/client/src/widgets/collections/NoteList.tsx
@@ -51,12 +51,12 @@ const ViewComponents: Record<ViewTypeOptions, { normal: LazyLoadedComponent, pri
}
export default function NoteList(props: Pick<NoteListProps, "displayOnlyCollections" | "media" | "onReady" | "onProgressChanged">) {
- const { note, noteContext, notePath, ntxId } = useNoteContext();
+ const { note, noteContext, notePath, ntxId, viewScope } = useNoteContext();
const viewType = useNoteViewType(note);
const [ enabled, setEnabled ] = useState(noteContext?.hasNoteList());
useEffect(() => {
setEnabled(noteContext?.hasNoteList());
- }, [ noteContext, viewType ])
+ }, [ noteContext, viewType, viewScope?.viewMode ])
return <CustomNoteList viewType={viewType} note={note} isEnabled={!!enabled} notePath={notePath} ntxId={ntxId} {...props} />
}