diff --git a/frontend/src/component/layout/MainLayout/NavigationSidebar/NavigationSidebar.tsx b/frontend/src/component/layout/MainLayout/NavigationSidebar/NavigationSidebar.tsx index 614522f83d..5953626a51 100644 --- a/frontend/src/component/layout/MainLayout/NavigationSidebar/NavigationSidebar.tsx +++ b/frontend/src/component/layout/MainLayout/NavigationSidebar/NavigationSidebar.tsx @@ -1,5 +1,5 @@ import { Box, styled } from '@mui/material'; -import { type FC, useState } from 'react'; +import { type FC, useState, useEffect } from 'react'; import { useNavigationMode } from './useNavigationMode'; import { ShowAdmin, ShowHide } from './ShowHide'; import { useRoutes } from './useRoutes'; @@ -67,6 +67,10 @@ export const NavigationSidebar = () => { const { lastViewed: lastViewedFlags } = useLastViewedFlags(); const showRecentFlags = mode === 'full' && lastViewedFlags.length > 0; + useEffect(() => { + setActiveItem(initialPathname); + }, [initialPathname]); + return ( setMode('full')} />