dna tested

This commit is contained in:
CPM
2025-07-30 16:16:07 +05:30
parent b0399b39c6
commit 979f4f332f
+4 -4
View File
@@ -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);
}
};