From 979f4f332f2338085e1c48ef7e1a7939dccd3cd6 Mon Sep 17 00:00:00 2001 From: CPM Date: Wed, 30 Jul 2025 16:16:07 +0530 Subject: [PATCH] dna tested --- src/screens/AuthScreen/Login/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/screens/AuthScreen/Login/index.js b/src/screens/AuthScreen/Login/index.js index d936477..64c0d01 100644 --- a/src/screens/AuthScreen/Login/index.js +++ b/src/screens/AuthScreen/Login/index.js @@ -19,7 +19,7 @@ import Geolocation from '@react-native-community/geolocation'; const Login = ({ navigation }) => { const [loading, setLoading] = useState(false); const dispatch = useDispatch(); - const [username, setUsername] = useState('testah'); + const [username, setUsername] = useState(''); // geo loc @@ -32,9 +32,6 @@ const Login = ({ navigation }) => { const onSubmit = () => { setLoading(true); getOTP(); - setTimeout(() => { - setLoading(false); - }, 100); }; const getOTP = async () => { @@ -57,14 +54,17 @@ const Login = ({ navigation }) => { const res = response.data || []; console.log('OTP is ===> ', res?.SendOTP); if (res?.SendOTP[0].OTP === '0' || res?.SendOTP[0].OTP === 0) { + setLoading(false); toastError("Alert", "Invalid User"); } else { toastSuccess("Alert", res?.SendOTP[0]?.Messages); navigation.navigate('VerifyOTP', { username: username }); + setLoading(false); } // console.log('getotpApi res==>', JSON.stringify(res?.SendOTP[0])); } catch (error) { console.log("❌ OTP API error:", error); + setLoading(false); } };