From 2c1423fbb2fa221fd0e95405a84b51a7899a2342 Mon Sep 17 00:00:00 2001 From: Micah Lindley Date: Wed, 4 Sep 2024 11:32:41 -0500 Subject: [PATCH] Fix login process issues --- src/screens/LoginScreen.jsx | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/screens/LoginScreen.jsx b/src/screens/LoginScreen.jsx index 9b57afd..be24015 100644 --- a/src/screens/LoginScreen.jsx +++ b/src/screens/LoginScreen.jsx @@ -73,7 +73,9 @@ function LoginScreen({}) { num ? 'AndroidPhoneNumberHint provided' : 'user provided' } number`, ); - const res = await API.loginViaSMS(num != undefined ? num : phoneNumber); + const res = await API.loginViaSMS( + num != undefined && num.length == 10 ? num : phoneNumber, + ); if (res) { if (res.error_code) { crashlytics().log(`Error sending SMS code: ${res.error_code}`); @@ -344,20 +346,23 @@ function LoginScreen({}) { Enter the code that you recieved at{' '} {phoneNumber || 'your phone number.'} - + + + { if (phoneNumber?.length == 10) { + setSmsCode(''); sendSMS(); } else { setPhase('sendSMS'); @@ -394,6 +400,7 @@ function LoginScreen({}) { style={{ marginBottom: 10, textAlign: 'center', + height: 20, }} value={myAge} keyboardType="number-pad"