diff options
author | RonyVidaur <rony.vidaur@gmail.com> | 2024-02-03 21:54:37 -0600 |
---|---|---|
committer | RonyVidaur <rony.vidaur@gmail.com> | 2024-02-03 21:54:37 -0600 |
commit | 6f228a598e5cf5c445dc255c608d3164b2a7b853 (patch) | |
tree | acfe5ce83952d02bd193e51f9592bc060d8569c2 /src | |
parent | 15e90356e7e5c23774d0c46389cc41080b619bb5 (diff) | |
download | voidsky-6f228a598e5cf5c445dc255c608d3164b2a7b853.tar.zst |
validate phone number based on country
Diffstat (limited to 'src')
-rw-r--r-- | src/view/com/auth/create/Step2.tsx | 9 |
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({ |