about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRonyVidaur <rony.vidaur@gmail.com>2024-02-03 21:54:37 -0600
committerRonyVidaur <rony.vidaur@gmail.com>2024-02-03 21:54:37 -0600
commit6f228a598e5cf5c445dc255c608d3164b2a7b853 (patch)
treeacfe5ce83952d02bd193e51f9592bc060d8569c2 /src
parent15e90356e7e5c23774d0c46389cc41080b619bb5 (diff)
downloadvoidsky-6f228a598e5cf5c445dc255c608d3164b2a7b853.tar.zst
validate phone number based on country
Diffstat (limited to 'src')
-rw-r--r--src/view/com/auth/create/Step2.tsx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/view/com/auth/create/Step2.tsx b/src/view/com/auth/create/Step2.tsx
index 6005ee3a5..626ff0e86 100644
--- a/src/view/com/auth/create/Step2.tsx
+++ b/src/view/com/auth/create/Step2.tsx
@@ -42,10 +42,11 @@ export function Step2({
   const {isMobile} = useWebMediaQueries()
 
   const onPressRequest = React.useCallback(() => {
-    if (
-      uiState.verificationPhone.length >= 9 &&
-      parsePhoneNumber(uiState.verificationPhone, uiState.phoneCountry)
-    ) {
+    const phoneNumber = parsePhoneNumber(
+      uiState.verificationPhone,
+      uiState.phoneCountry,
+    );
+    if (phoneNumber.isValid()) {
       requestVerificationCode({uiState, uiDispatch, _})
     } else {
       uiDispatch({