diff --git a/gui/src/components/Layout.tsx b/gui/src/components/Layout.tsx index 42bea5cd8..eceacb315 100644 --- a/gui/src/components/Layout.tsx +++ b/gui/src/components/Layout.tsx @@ -1,5 +1,5 @@ import { OnboardingModes } from "core/protocol/core"; -import { useContext, useEffect, useState } from "react"; +import { useContext, useEffect, useMemo, useState } from "react"; import { Outlet, useLocation, useNavigate } from "react-router-dom"; import styled from "styled-components"; import { CustomScrollbarDiv } from "."; @@ -54,8 +54,12 @@ const Layout = () => { const showDialog = useAppSelector((state) => state.ui.showDialog); const isInEdit = useAppSelector((store) => store.session.isInEdit); - const isHome = - location.pathname === "/" || location.pathname === "/index.html"; + const isHome = useMemo(() => { + return ( + location.pathname === ROUTES.HOME || + location.pathname === ROUTES.HOME_INDEX + ); + }, []); useEffect(() => { (async () => { diff --git a/gui/src/util/navigation.ts b/gui/src/util/navigation.ts index c037c024e..26d318aab 100644 --- a/gui/src/util/navigation.ts +++ b/gui/src/util/navigation.ts @@ -12,6 +12,7 @@ export type ConfigTab = // TODO: Move all the routes here export const ROUTES = { HOME: "/", + HOME_INDEX: "/index.html", CONFIG: "/config", THEME: "/theme", STATS: "/stats",