🩹(frontend) preload notifications translations to prevent flickering
The notifications namespace was being lazy-loaded when the first notification appeared, causing a screen flicker during translation loading. Now preloading the namespace during i18n initialization to ensure smooth rendering.
This commit is contained in:
committed by
aleb_the_flash
parent
0a63270154
commit
0498a9e7f9
@@ -12,6 +12,7 @@ import {
|
|||||||
ANIMATION_DURATION,
|
ANIMATION_DURATION,
|
||||||
ReactionPortals,
|
ReactionPortals,
|
||||||
} from '@/features/rooms/livekit/components/ReactionPortal'
|
} from '@/features/rooms/livekit/components/ReactionPortal'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
export const MainNotificationToast = () => {
|
export const MainNotificationToast = () => {
|
||||||
const room = useRoomContext()
|
const room = useRoomContext()
|
||||||
@@ -186,6 +187,10 @@ export const MainNotificationToast = () => {
|
|||||||
}
|
}
|
||||||
}, [room])
|
}, [room])
|
||||||
|
|
||||||
|
// Without this line, when the component first renders,
|
||||||
|
// the 'notifications' namespace might not be loaded yet
|
||||||
|
useTranslation(['notifications'])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Div position="absolute" bottom={0} right={5} zIndex={1000}>
|
<Div position="absolute" bottom={0} right={5} zIndex={1000}>
|
||||||
<ToastProvider />
|
<ToastProvider />
|
||||||
|
|||||||
Reference in New Issue
Block a user