group creation themed
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
KeyboardAvoidingView,
|
||||
StatusBar,
|
||||
Alert,
|
||||
ToastAndroid,
|
||||
} from "react-native";
|
||||
import { RootStackParamList } from "../navigation/AppNavigator";
|
||||
import * as Keychain from "react-native-keychain";
|
||||
@@ -84,13 +85,11 @@ export default function OtpVerificationScreen() {
|
||||
console.log("✅ OTP Verified:", res.data);
|
||||
if (res.data.statusCode === 200) {
|
||||
saveToken(res.data.data);
|
||||
|
||||
navigation.navigate('HomeTabs')
|
||||
|
||||
}
|
||||
navigation.navigate('Home')
|
||||
ToastAndroid.show("OTP Verified Successfully!", ToastAndroid.SHORT);}
|
||||
} catch (err: any) {
|
||||
console.error("❌ OTP Verification Error:", err?.response?.data || err.message);
|
||||
Alert.alert("Error", "Failed to verify OTP. Please try again.");
|
||||
ToastAndroid.show(err.message || "Invalid OTP. Please try again.", ToastAndroid.SHORT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -100,16 +99,17 @@ export default function OtpVerificationScreen() {
|
||||
setTimer(30); // reset timer
|
||||
|
||||
const res = await axios.get(
|
||||
LOGIN_URL+mobile,
|
||||
LOGIN_URL + mobile,
|
||||
{ headers: { "Content-Type": "application/json", Accept: "*/*" } }
|
||||
);
|
||||
|
||||
console.log("📩 OTP Resent:", res.data);
|
||||
|
||||
Alert.alert("OTP Sent", "A new OTP has been sent to your mobile.");
|
||||
setCode(Array(CELL_COUNT).fill(""));
|
||||
inputs.current[0]?.focus();
|
||||
ToastAndroid.show("OTP Sent", ToastAndroid.SHORT);
|
||||
} catch (err: any) {
|
||||
console.error("❌ Resend OTP Error:", err?.response?.data || err.message);
|
||||
Alert.alert("Error", "Failed to resend OTP. Try again later.");
|
||||
ToastAndroid.show("Failed to resend OTP. Try again later.", ToastAndroid.SHORT);
|
||||
} finally {
|
||||
setIsResending(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user