diff --git a/src/utils/panes/index.tsx b/src/utils/panes/index.tsx index 22a25de594..1403d58b2b 100644 --- a/src/utils/panes/index.tsx +++ b/src/utils/panes/index.tsx @@ -1,10 +1,12 @@ import { makeStyles } from '@mui/styles'; +import { useRouter } from 'next/router'; import { Box, Paper, Slide } from '@mui/material'; import { createContext, FC, ReactNode, useContext, + useEffect, useRef, useState, } from 'react'; @@ -57,10 +59,15 @@ export const PaneProvider: FC = ({ const [open, setOpen] = useState(false); const styles = useStyles(); const [key, setKey] = useState(0); + const { pathname } = useRouter(); const { paneContainerRef, slideRef, updatePaneHeight } = useResizablePane(fixedHeight); + useEffect(() => { + setOpen(false); + }, [pathname]); + return (