Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions apps/mobile/src/components/login-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ export function LoginScreen() {
[signIn]
);

useEffect(() => {
if (sessionEnded) {
// id dedupes the toast if the login route remounts while still signed out
toast('Your session ended. Please sign in again.', { id: 'session-ended' });
Comment thread
iscekic marked this conversation as resolved.
Resolved
}
}, [sessionEnded]);

useEffect(() => {
if (status === 'approved' && token) {
void persistToken(token, refreshToken, expiresIn);
Expand Down Expand Up @@ -186,16 +193,7 @@ export function LoginScreen() {
recovering only on relaunch — so these branches render without
animation; status swaps are instant. */}
<View className="w-full max-w-sm gap-3">
{status === 'idle' && (
<View className="w-full gap-3">
{sessionEnded && (
<Text className="text-center text-sm text-muted-foreground">
Your session ended. Please sign in again.
</Text>
)}
<IdleAuth start={start} />
</View>
)}
{status === 'idle' && <IdleAuth start={start} />}

{status === 'pending' && code && (
<View className="w-full items-center gap-4">
Expand Down