mirror of
https://github.com/TriliumNext/Trilium.git
synced 2025-12-10 21:07:05 -06:00
fix(client/collections): collections not visible after viewing attachments
This commit is contained in:
parent
f83c46d1c7
commit
0a3e788d21
@ -51,12 +51,12 @@ const ViewComponents: Record<ViewTypeOptions, { normal: LazyLoadedComponent, pri
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function NoteList(props: Pick<NoteListProps, "displayOnlyCollections" | "media" | "onReady" | "onProgressChanged">) {
|
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 viewType = useNoteViewType(note);
|
||||||
const [ enabled, setEnabled ] = useState(noteContext?.hasNoteList());
|
const [ enabled, setEnabled ] = useState(noteContext?.hasNoteList());
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setEnabled(noteContext?.hasNoteList());
|
setEnabled(noteContext?.hasNoteList());
|
||||||
}, [ noteContext, viewType ])
|
}, [ noteContext, viewType, viewScope?.viewMode ])
|
||||||
return <CustomNoteList viewType={viewType} note={note} isEnabled={!!enabled} notePath={notePath} ntxId={ntxId} {...props} />
|
return <CustomNoteList viewType={viewType} note={note} isEnabled={!!enabled} notePath={notePath} ntxId={ntxId} {...props} />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user