From c6e965d32c0028c9234af41dd3ecf27029e03150 Mon Sep 17 00:00:00 2001 From: Sui Sin <103026762+suisin-deriv@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:25:40 +0800 Subject: [PATCH] [UPM1539] Suisin/fix: user coming from personal detail when verified not route to TH (#17101) * fix: user coming from personal detail when verified not route to TH * chore: fix routing issue when coming from personal details page --- .../src/Sections/Profile/PersonalDetails/verify-button.tsx | 1 + .../Profile/PhoneVerification/phone-number-verified-modal.tsx | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/account/src/Sections/Profile/PersonalDetails/verify-button.tsx b/packages/account/src/Sections/Profile/PersonalDetails/verify-button.tsx index 4cf7782dca0e..428b6bc1208e 100644 --- a/packages/account/src/Sections/Profile/PersonalDetails/verify-button.tsx +++ b/packages/account/src/Sections/Profile/PersonalDetails/verify-button.tsx @@ -56,6 +56,7 @@ export const VerifyButton = observer( const redirectToPhoneVerification = (e: React.MouseEvent) => { e.preventDefault(); + localStorage.setItem('routes_from_notification_to_pnv', routes.personal_details); setVerificationCode('', 'phone_number_verification'); setShouldShowPhoneNumberOTP(false); const request = makeSettingsRequest({ ...values }, residence_list, states_list, is_virtual); diff --git a/packages/account/src/Sections/Profile/PhoneVerification/phone-number-verified-modal.tsx b/packages/account/src/Sections/Profile/PhoneVerification/phone-number-verified-modal.tsx index 759f4c1c064a..f21e90028f6f 100644 --- a/packages/account/src/Sections/Profile/PhoneVerification/phone-number-verified-modal.tsx +++ b/packages/account/src/Sections/Profile/PhoneVerification/phone-number-verified-modal.tsx @@ -15,8 +15,7 @@ const PhoneNumberVerifiedModal = observer(({ should_show_phone_number_verified_m const history = useHistory(); const previous_route = localStorage.getItem('routes_from_notification_to_pnv'); const should_route_back_to_previous = - !!previous_route && - (previous_route !== routes.personal_details || previous_route !== routes.phone_verification); + previous_route !== routes.personal_details && previous_route !== routes.phone_verification && !!previous_route; const handleDoneButton = () => { localStorage.removeItem('routes_from_notification_to_pnv');