From dfd4be54acda1adbe44dd7f71826c1482c689a95 Mon Sep 17 00:00:00 2001 From: David May <85513542+davidleomay@users.noreply.github.com> Date: Fri, 13 Mar 2026 13:56:28 +0100 Subject: [PATCH] fix: verification call settings (#998) --- src/screens/settings.screen.tsx | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/screens/settings.screen.tsx b/src/screens/settings.screen.tsx index 5c4ed3f4..e30ef435 100644 --- a/src/screens/settings.screen.tsx +++ b/src/screens/settings.screen.tsx @@ -40,6 +40,12 @@ import { useLayoutOptions } from 'src/hooks/layout-config.hook'; import { useNavigation } from 'src/hooks/navigation.hook'; import { blankedAddress, sortAddressesByBlockchain } from 'src/util/utils'; +function toAcceptCall(status?: PhoneCallStatus): boolean | undefined { + if (status === PhoneCallStatus.ACCEPTED) return true; + if (status === PhoneCallStatus.REJECTED) return false; + return undefined; +} + interface FormData { language: Language; currency: Fiat; @@ -109,12 +115,9 @@ export default function SettingsScreen(): JSX.Element { }, [user?.kyc.preferredPhoneTimes]); useEffect(() => { - if (user?.kyc.phoneCallStatus && acceptCall === undefined) { - if (user.kyc.phoneCallStatus === PhoneCallStatus.ACCEPTED) { - setValue('acceptCall', true); - } else if (user.kyc.phoneCallStatus === PhoneCallStatus.REJECTED) { - setValue('acceptCall', false); - } + const value = toAcceptCall(user?.kyc.phoneCallStatus); + if (value !== undefined && acceptCall === undefined) { + setValue('acceptCall', value); } }, [user?.kyc.phoneCallStatus]); @@ -131,13 +134,16 @@ export default function SettingsScreen(): JSX.Element { }, [selectedCurrency]); useEffect(() => { - if (selectedPreferredPhoneTimes) { + if ( + selectedPreferredPhoneTimes && + JSON.stringify(selectedPreferredPhoneTimes) !== JSON.stringify(user?.kyc.preferredPhoneTimes) + ) { updateCallSettings(selectedPreferredPhoneTimes); } }, [selectedPreferredPhoneTimes]); useEffect(() => { - if (acceptCall !== undefined) { + if (acceptCall !== undefined && acceptCall !== toAcceptCall(user?.kyc.phoneCallStatus)) { updateCallSettings(undefined, acceptCall); } }, [acceptCall]); @@ -245,11 +251,7 @@ export default function SettingsScreen(): JSX.Element { ) )} - {isUserLoading && !isLoadingBankAccounts ? ( -
- -
- ) : ( + {!isUserLoading && ( navigate('/connect')} @@ -301,8 +303,9 @@ export default function SettingsScreen(): JSX.Element { /> )} - {(!user?.kyc.phoneCallStatus || - ![PhoneCallStatus.COMPLETED, PhoneCallStatus.FAILED].includes(user.kyc.phoneCallStatus)) && ( + {!isUserLoading && + (!user?.kyc.phoneCallStatus || + ![PhoneCallStatus.COMPLETED, PhoneCallStatus.FAILED].includes(user.kyc.phoneCallStatus)) && (