mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-06 17:07:46 +00:00
e210f26f9c
Fix calendar integration by preventing silent login triggers within webmail iframes. Refactor code to only initialize app components when not in SDK context. Resolves unexpected behavior in Firefox where iframes were incorrectly rendering the homepage instead of intended calendar content.
48 lines
1.5 KiB
TypeScript
48 lines
1.5 KiB
TypeScript
import '@livekit/components-styles'
|
|
import '@/styles/index.css'
|
|
import { Suspense } from 'react'
|
|
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
|
|
import { QueryClientProvider } from '@tanstack/react-query'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { useLang } from 'hoofd'
|
|
import { Switch, Route } from 'wouter'
|
|
import { I18nProvider } from 'react-aria-components'
|
|
import { Layout } from './layout/Layout'
|
|
import { NotFoundScreen } from './components/NotFoundScreen'
|
|
import { routes } from './routes'
|
|
import './i18n/init'
|
|
import { queryClient } from '@/api/queryClient'
|
|
import { AppInitialization } from '@/components/AppInitialization'
|
|
import { useIsSdkContext } from '@/features/sdk/hooks/useIsSdkContext'
|
|
|
|
function App() {
|
|
const { i18n } = useTranslation()
|
|
useLang(i18n.language)
|
|
|
|
const isSDKContext = useIsSdkContext()
|
|
|
|
return (
|
|
<QueryClientProvider client={queryClient}>
|
|
{!isSDKContext && <AppInitialization />}
|
|
<Suspense fallback={null}>
|
|
<I18nProvider locale={i18n.language}>
|
|
<Layout>
|
|
<Switch>
|
|
{Object.entries(routes).map(([, route], i) => (
|
|
<Route key={i} path={route.path} component={route.Component} />
|
|
))}
|
|
<Route component={NotFoundScreen} />
|
|
</Switch>
|
|
</Layout>
|
|
<ReactQueryDevtools
|
|
initialIsOpen={false}
|
|
buttonPosition="bottom-left"
|
|
/>
|
|
</I18nProvider>
|
|
</Suspense>
|
|
</QueryClientProvider>
|
|
)
|
|
}
|
|
|
|
export default App
|