mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-05 16:37:43 +00:00
fixup! ✨(frontend) add connection test feature
This commit is contained in:
@@ -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 (
|
||||
<Screen layout="centered">
|
||||
<Permissions />
|
||||
|
||||
@@ -266,16 +266,18 @@ export const Footer = () => {
|
||||
{t('links.accessibility')}
|
||||
</Link>
|
||||
</StyledLi>
|
||||
<StyledLi divider>
|
||||
<Link
|
||||
underline={false}
|
||||
footer="minor"
|
||||
to="/test-connection"
|
||||
aria-label={t('links.connectionTest')}
|
||||
>
|
||||
{t('links.connectionTest')}
|
||||
</Link>
|
||||
</StyledLi>
|
||||
{data?.diagnostics?.connection_test_enabled && (
|
||||
<StyledLi divider>
|
||||
<Link
|
||||
underline={false}
|
||||
footer="minor"
|
||||
to="/test-connection"
|
||||
aria-label={t('links.connectionTest')}
|
||||
>
|
||||
{t('links.connectionTest')}
|
||||
</Link>
|
||||
</StyledLi>
|
||||
)}
|
||||
<StyledLi>
|
||||
<A
|
||||
externalIcon
|
||||
|
||||
Reference in New Issue
Block a user