diff --git a/front/Navigation.tsx b/front/Navigation.tsx index b40b398..ec39e35 100644 --- a/front/Navigation.tsx +++ b/front/Navigation.tsx @@ -115,11 +115,6 @@ const publicRoutes = () => options: { title: translate('signUpBtn'), headerShown: false }, link: '/signup', }, - Oops: { - component: ProfileErrorView, - options: { title: 'Oops', headerShown: false }, - link: undefined, - }, Google: { component: GoogleView, options: { title: 'Google signin', headerShown: false }, @@ -156,7 +151,7 @@ type PrivateRoutesParams = RouteParams>; type PublicRoutesParams = RouteParams>; type AppRouteParams = PrivateRoutesParams & PublicRoutesParams; -const Stack = createNativeStackNavigator(); +const Stack = createNativeStackNavigator(); const RouteToScreen = (component: Route['component']) => @@ -204,6 +199,8 @@ const routesToLinkingConfig = ( const ProfileErrorView = (props: { onTryAgain: () => void }) => { const dispatch = useDispatch(); + const navigation = useNavigation(); + return (
@@ -212,7 +209,10 @@ const ProfileErrorView = (props: { onTryAgain: () => void }) => { dispatch(unsetAccessToken())} + onPress={() => { + dispatch(unsetAccessToken()); + navigation.navigate('Start'); + }} colorScheme="error" variant="outline" translate={{ translationKey: 'signOutBtn' }} @@ -273,12 +273,15 @@ export const Router = () => { > {authStatus == 'error' ? ( - ( - userProfile.refetch()} /> - ))} - /> + <> + ( + userProfile.refetch()} /> + ))} + /> + {routesToScreens(publicRoutes())} + ) : ( routesToScreens(routes) )}