fix(logs): stop always keeping logs route mounted

This commit is contained in:
Tunglies
2026-06-03 21:56:33 +08:00
parent 462d9f536d
commit bc2149c66d
2 changed files with 2 additions and 5 deletions
+1 -4
View File
@@ -121,8 +121,6 @@ const Layout = () => {
const navigate = useNavigate()
const { pathname } = useLocation()
const isLogsPage = pathname === '/logs'
const logsPageMountedRef = useRef(false)
if (isLogsPage) logsPageMountedRef.current = true
const themeReady = useMemo(() => Boolean(theme), [theme])
const [menuUnlocked, setMenuUnlocked] = useState(false)
@@ -455,7 +453,7 @@ const Layout = () => {
<BaseErrorBoundary>
<Outlet />
</BaseErrorBoundary>
{logsPageMountedRef.current && (
{isLogsPage && (
<div
style={{
position: 'absolute',
@@ -463,7 +461,6 @@ const Layout = () => {
left: 0,
right: 0,
bottom: 0,
display: isLogsPage ? undefined : 'none',
}}
>
<LogsPage />
+1 -1
View File
@@ -61,7 +61,7 @@ export const navItems = [
label: 'layout.components.navigation.tabs.logs',
path: '/logs',
icon: [<SubjectRoundedIcon key="mui" />, <LogsSvg key="svg" />],
Component: () => null /* KeepAlive: real LogsPage rendered in Layout */,
Component: () => null /* LogsPage rendered in Layout only on /logs route */,
},
{
label: 'layout.components.navigation.tabs.unlock',