From 51e2d778beebe8dad33f15f314940fb5fd2558cf Mon Sep 17 00:00:00 2001 From: Samandar Turgunboyev Date: Thu, 11 Dec 2025 16:10:33 +0500 Subject: [PATCH] navihate --- src/screens/auth/login/ui/Confirm.tsx | 5 ++++- src/screens/auth/registeration/ui/SecondStep.tsx | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/screens/auth/login/ui/Confirm.tsx b/src/screens/auth/login/ui/Confirm.tsx index c633858..0819a7a 100644 --- a/src/screens/auth/login/ui/Confirm.tsx +++ b/src/screens/auth/login/ui/Confirm.tsx @@ -78,7 +78,10 @@ const Confirm = () => { mutationFn: (payload: otpPayload) => authApi.verifyOtp(payload), onSuccess: async res => { await AsyncStorage.setItem('token', res.data.accessToken); - navigation.navigate('Home'); + navigation.reset({ + index: 0, + routes: [{ name: 'Home' }], // login sahifasiga qaytarish + }); setVisible(false); }, onError: (err: any) => { diff --git a/src/screens/auth/registeration/ui/SecondStep.tsx b/src/screens/auth/registeration/ui/SecondStep.tsx index 355e70c..555fb02 100644 --- a/src/screens/auth/registeration/ui/SecondStep.tsx +++ b/src/screens/auth/registeration/ui/SecondStep.tsx @@ -13,7 +13,6 @@ import AppText from 'components/AppText'; import DatePickerInput from 'components/DatePicker'; import ErrorNotification from 'components/ErrorNotification'; import SingleFileDrop from 'components/FileDrop'; -import { saveAuth } from 'helpers/event'; import { useEffect, useRef, useState } from 'react'; import { Controller, useForm } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; @@ -80,8 +79,10 @@ const SecondStep = () => { mutationFn: (payload: sendPassportPayload) => passportApi.sendPassport(payload), onSuccess: res => { - navigation.replace('Home'); - saveAuth(); + navigation.reset({ + index: 0, + routes: [{ name: 'Home' }], + }); }, onError: (err: any) => { setError(err?.response?.data || 'Xatolik yuz berdi');