From e7290d6f9c218cfffd4b6082279c19f69278fb17 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Fri, 29 May 2026 17:18:45 +0000 Subject: [PATCH] mobile: fix typed routes - router.push/replace avec objet pathname typedRoutes=true dans app.json interdit les string literals Tous les router.push/replace convertis en { pathname } object Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- memento-mobile/app/(tabs)/home.tsx | 6 +++--- memento-mobile/app/_layout.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/memento-mobile/app/(tabs)/home.tsx b/memento-mobile/app/(tabs)/home.tsx index ff96da0..7393f35 100644 --- a/memento-mobile/app/(tabs)/home.tsx +++ b/memento-mobile/app/(tabs)/home.tsx @@ -66,7 +66,7 @@ export default function HomeScreen() { {greeting}{firstName ? `, ${firstName}` : ''} {now.toLocaleDateString('fr-FR', { weekday: 'long', day: 'numeric', month: 'long' })} - router.push('/(tabs)/search')} style={s.searchBtn}> + router.push({ pathname: '/(tabs)/search' })} style={s.searchBtn}> @@ -79,13 +79,13 @@ export default function HomeScreen() { Note du jour - router.push('/(tabs)/search')} style={s.quickCard} activeOpacity={0.7}> + router.push({ pathname: '/(tabs)/search' })} style={s.quickCard} activeOpacity={0.7}> Nouvelle note - router.push('/(tabs)/search')} style={s.quickCard} activeOpacity={0.7}> + router.push({ pathname: '/(tabs)/search' })} style={s.quickCard} activeOpacity={0.7}> diff --git a/memento-mobile/app/_layout.tsx b/memento-mobile/app/_layout.tsx index b588547..c0752ee 100644 --- a/memento-mobile/app/_layout.tsx +++ b/memento-mobile/app/_layout.tsx @@ -19,8 +19,8 @@ export default function RootLayout() { useEffect(() => { if (loading) return const inAuth = segments[0] === '(auth)' - if (!user && !inAuth) router.replace('/(auth)/login') - else if (user && inAuth) router.replace('/(tabs)/home') + if (!user && !inAuth) router.replace({ pathname: '/(auth)/login' }) + else if (user && inAuth) router.replace({ pathname: '/(tabs)/home' }) }, [user, loading, segments]) if (loading) {