dna tested
This commit is contained in:
@@ -19,7 +19,7 @@ import Geolocation from '@react-native-community/geolocation';
|
|||||||
const Login = ({ navigation }) => {
|
const Login = ({ navigation }) => {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const [username, setUsername] = useState('testah');
|
const [username, setUsername] = useState('');
|
||||||
|
|
||||||
|
|
||||||
// geo loc
|
// geo loc
|
||||||
@@ -32,9 +32,6 @@ const Login = ({ navigation }) => {
|
|||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
getOTP();
|
getOTP();
|
||||||
setTimeout(() => {
|
|
||||||
setLoading(false);
|
|
||||||
}, 100);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getOTP = async () => {
|
const getOTP = async () => {
|
||||||
@@ -57,14 +54,17 @@ const Login = ({ navigation }) => {
|
|||||||
const res = response.data || [];
|
const res = response.data || [];
|
||||||
console.log('OTP is ===> ', res?.SendOTP);
|
console.log('OTP is ===> ', res?.SendOTP);
|
||||||
if (res?.SendOTP[0].OTP === '0' || res?.SendOTP[0].OTP === 0) {
|
if (res?.SendOTP[0].OTP === '0' || res?.SendOTP[0].OTP === 0) {
|
||||||
|
setLoading(false);
|
||||||
toastError("Alert", "Invalid User");
|
toastError("Alert", "Invalid User");
|
||||||
} else {
|
} else {
|
||||||
toastSuccess("Alert", res?.SendOTP[0]?.Messages);
|
toastSuccess("Alert", res?.SendOTP[0]?.Messages);
|
||||||
navigation.navigate('VerifyOTP', { username: username });
|
navigation.navigate('VerifyOTP', { username: username });
|
||||||
|
setLoading(false);
|
||||||
}
|
}
|
||||||
// console.log('getotpApi res==>', JSON.stringify(res?.SendOTP[0]));
|
// console.log('getotpApi res==>', JSON.stringify(res?.SendOTP[0]));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("❌ OTP API error:", error);
|
console.log("❌ OTP API error:", error);
|
||||||
|
setLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user