mirror of
https://github.com/stashapp/stash.git
synced 2026-04-21 06:22:29 +02:00
Fix contents not loading in filter sidebar (#6240)
This commit is contained in:
parent
beee37bc38
commit
2925325e68
2 changed files with 18 additions and 1 deletions
|
|
@ -275,6 +275,7 @@ export const SidebarListFilter: React.FC<{
|
|||
postSelected?: React.ReactNode;
|
||||
preCandidates?: React.ReactNode;
|
||||
postCandidates?: React.ReactNode;
|
||||
onOpen?: () => void;
|
||||
// used to store open/closed state in SidebarStateContext
|
||||
sectionID?: string;
|
||||
}> = ({
|
||||
|
|
@ -292,6 +293,7 @@ export const SidebarListFilter: React.FC<{
|
|||
postCandidates,
|
||||
preSelected,
|
||||
postSelected,
|
||||
onOpen,
|
||||
sectionID,
|
||||
}) => {
|
||||
// TODO - sort items?
|
||||
|
|
@ -344,6 +346,7 @@ export const SidebarListFilter: React.FC<{
|
|||
{postSelected ? <div className="extra">{postSelected}</div> : null}
|
||||
</>
|
||||
}
|
||||
onOpen={onOpen}
|
||||
>
|
||||
{preCandidates ? <div className="extra">{preCandidates}</div> : null}
|
||||
<CandidateList
|
||||
|
|
|
|||
|
|
@ -76,10 +76,18 @@ export const SidebarSection: React.FC<
|
|||
text: React.ReactNode;
|
||||
className?: string;
|
||||
outsideCollapse?: React.ReactNode;
|
||||
onOpen?: () => void;
|
||||
// used to store open/closed state in SidebarStateContext
|
||||
sectionID?: string;
|
||||
}>
|
||||
> = ({ className = "", text, outsideCollapse, sectionID = "", children }) => {
|
||||
> = ({
|
||||
className = "",
|
||||
text,
|
||||
outsideCollapse,
|
||||
onOpen,
|
||||
sectionID = "",
|
||||
children,
|
||||
}) => {
|
||||
// this is optional
|
||||
const contextState = React.useContext(SidebarStateContext);
|
||||
const openState =
|
||||
|
|
@ -93,6 +101,12 @@ export const SidebarSection: React.FC<
|
|||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (openState && onOpen) {
|
||||
onOpen();
|
||||
}
|
||||
}, [openState, onOpen]);
|
||||
|
||||
const collapseProps: Partial<CollapseProps> = {
|
||||
mountOnEnter: true,
|
||||
unmountOnExit: true,
|
||||
|
|
|
|||
Loading…
Reference in a new issue