From 52bc696a2d2b1faf58f289934e067da2666302ae Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Tue, 4 Aug 2026 23:50:40 +0200 Subject: [PATCH] =?UTF-8?q?fixup!=20=E2=9C=A8(frontend)=20add=20connection?= =?UTF-8?q?=20test=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../diagnostics/routes/ConnectionTest.tsx | 11 ++++++++++ src/frontend/src/layout/Footer.tsx | 22 ++++++++++--------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/frontend/src/features/diagnostics/routes/ConnectionTest.tsx b/src/frontend/src/features/diagnostics/routes/ConnectionTest.tsx index 3d771417..d4eb3134 100644 --- a/src/frontend/src/features/diagnostics/routes/ConnectionTest.tsx +++ b/src/frontend/src/features/diagnostics/routes/ConnectionTest.tsx @@ -17,6 +17,8 @@ import { ConnectionTestStepRow } from '../components/ConnectionTestStepRow' import { ConnectionTestSummary } from '../components/ConnectionTestSummary' import { CONNECTION_TEST_GROUPS, summarizeSteps } from '../types' import { downloadConnectionTestReport } from '../utils/downloadConnectionTestReport' +import { useConfig } from '@/api/useConfig' +import { navigateTo } from '@/navigation/navigateTo' const HIDE_LIVEKIT_VIDEO_CLASS = 'connection-test-hide-livekit-video' @@ -59,6 +61,7 @@ const helpIconClass = css({ }) const ConnectionTest = () => { + const { data, isLoading } = useConfig() const { t } = useTranslation('connectionTest') const { steps, isRunning, runTest, reset } = useConnectionTestRunner() @@ -82,6 +85,14 @@ const ConnectionTest = () => { } }, [isPublishVideoRunning]) + useEffect(() => { + // Wait for config to load, otherwise we'd redirect off a page + // that's actually enabled. + if (!isLoading && !data?.diagnostics?.connection_test_enabled) { + navigateTo('home', undefined, { replace: true }) + } + }, [isLoading, data]) + return ( diff --git a/src/frontend/src/layout/Footer.tsx b/src/frontend/src/layout/Footer.tsx index 671f77a5..cfbfc426 100644 --- a/src/frontend/src/layout/Footer.tsx +++ b/src/frontend/src/layout/Footer.tsx @@ -266,16 +266,18 @@ export const Footer = () => { {t('links.accessibility')} - - - {t('links.connectionTest')} - - + {data?.diagnostics?.connection_test_enabled && ( + + + {t('links.connectionTest')} + + + )}