diff --git a/apps/mobile/src/components/login-screen.tsx b/apps/mobile/src/components/login-screen.tsx index 6b15eb2aef..a5cebcc637 100644 --- a/apps/mobile/src/components/login-screen.tsx +++ b/apps/mobile/src/components/login-screen.tsx @@ -24,6 +24,7 @@ import { errorMessage } from '@/components/login-screen-state'; import { Button } from '@/components/ui/button'; import { Image } from '@/components/ui/image'; import { Text } from '@/components/ui/text'; +import { announcingToast } from '@/lib/a11y/announcing-toast'; import { useAuth } from '@/lib/auth/auth-context'; import { useDeviceAuth } from '@/lib/auth/use-device-auth'; import { useThemeColors } from '@/lib/hooks/use-theme-colors'; @@ -63,6 +64,13 @@ export function LoginScreen() { [signIn] ); + useEffect(() => { + if (sessionEnded) { + // id dedupes the toast if the login route remounts while still signed out + announcingToast.warning('Your session ended. Please sign in again.', { id: 'session-ended' }); + } + }, [sessionEnded]); + useEffect(() => { if (status === 'approved' && token) { void persistToken(token, refreshToken, expiresIn); @@ -186,16 +194,7 @@ export function LoginScreen() { recovering only on relaunch — so these branches render without animation; status swaps are instant. */} - {status === 'idle' && ( - - {sessionEnded && ( - - Your session ended. Please sign in again. - - )} - - - )} + {status === 'idle' && } {status === 'pending' && code && (