From b08096d1ed3f6f6e8b043aebd1a28e564a69d97b Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Fri, 20 Dec 2024 14:12:40 +0000 Subject: [PATCH] rename --- frontend/src/lib/components/DebugNotice.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/lib/components/DebugNotice.tsx b/frontend/src/lib/components/DebugNotice.tsx index 4dddd9fb7cd2d..2eba70ea3c6c2 100644 --- a/frontend/src/lib/components/DebugNotice.tsx +++ b/frontend/src/lib/components/DebugNotice.tsx @@ -10,7 +10,7 @@ import { navigation3000Logic } from '~/layout/navigation-3000/navigationLogic' export function DebugNotice(): JSX.Element | null { const [debugInfo, setDebugInfo] = useState<{ branch: string; revision: string } | undefined>() const [noticeHidden, setNoticeHidden] = useState(false) - const [isPort8000, setIsPort8000] = useState(false) + const [isLocalPort8000, setIsLocalPort8000] = useState(false) const { isNavCollapsed } = useValues(navigation3000Logic) @@ -19,20 +19,20 @@ export function DebugNotice(): JSX.Element | null { const port = window.location.port if (isLocal && port === '8000') { - setIsPort8000(true) + setIsLocalPort8000(true) } }, []) const redirectOrHideOnClick = useMemo( () => - isPort8000 + isLocalPort8000 ? () => { window.location.assign( `${window.location.protocol}//${window.location.hostname}:8010${window.location.pathname}${window.location.search}${window.location.hash}` ) } : () => setNoticeHidden(true), - [isPort8000] + [isLocalPort8000] ) useEffect(() => { @@ -56,7 +56,7 @@ export function DebugNotice(): JSX.Element | null { return null } - if (!isPort8000 && noticeHidden) { + if (!isLocalPort8000 && noticeHidden) { return null } @@ -77,7 +77,7 @@ export function DebugNotice(): JSX.Element | null { Revision: {debugInfo.revision}
- {isPort8000 ? ( + {isLocalPort8000 ? ( <>Development should run on port 8010 now! Click to redirect ) : ( <>Click to hide @@ -101,7 +101,7 @@ export function DebugNotice(): JSX.Element | null { onClick={() => setNoticeHidden(true)} />
- {isPort8000 && ( + {isLocalPort8000 && (