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

This commit is contained in:
Elian Doran 2025-11-23 21:53:47 +02:00
parent f83c46d1c7
commit 0a3e788d21
No known key found for this signature in database

View File

@ -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} />
}