From 6f228a598e5cf5c445dc255c608d3164b2a7b853 Mon Sep 17 00:00:00 2001 From: RonyVidaur Date: Sat, 3 Feb 2024 21:54:37 -0600 Subject: [PATCH] validate phone number based on country --- src/view/com/auth/create/Step2.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/view/com/auth/create/Step2.tsx b/src/view/com/auth/create/Step2.tsx index 6005ee3a58..626ff0e861 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({