From a74817869a10f36c8bb0e10146afdef02f1db8ae Mon Sep 17 00:00:00 2001 From: thelullabyy Date: Thu, 1 May 2025 15:42:28 +0700 Subject: [PATCH 1/2] fix: return early avoid applying unintended logic after naviagte --- src/pages/settings/InitialSettingsPage.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/settings/InitialSettingsPage.tsx b/src/pages/settings/InitialSettingsPage.tsx index a747cac299ba..0353644c589a 100755 --- a/src/pages/settings/InitialSettingsPage.tsx +++ b/src/pages/settings/InitialSettingsPage.tsx @@ -313,6 +313,10 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr const getWalletBalance = (isPaymentItem: boolean): string | undefined => (isPaymentItem ? convertToDisplayString(userWallet?.currentBalance) : undefined); const openPopover = (link: string | (() => Promise) | undefined, event: GestureResponderEvent | MouseEvent) => { + if (Navigation.getActiveRoute() !== '/settings') { + return; + } + if (typeof link === 'function') { link?.()?.then((url) => showContextMenu({ From d701ad0fa40cfb0b75b939748ed3f73d64e2f579 Mon Sep 17 00:00:00 2001 From: thelullabyy Date: Tue, 6 May 2025 10:27:09 +0700 Subject: [PATCH 2/2] refactor code --- src/pages/settings/InitialSettingsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/InitialSettingsPage.tsx b/src/pages/settings/InitialSettingsPage.tsx index 0353644c589a..54234ad0c35b 100755 --- a/src/pages/settings/InitialSettingsPage.tsx +++ b/src/pages/settings/InitialSettingsPage.tsx @@ -313,7 +313,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr const getWalletBalance = (isPaymentItem: boolean): string | undefined => (isPaymentItem ? convertToDisplayString(userWallet?.currentBalance) : undefined); const openPopover = (link: string | (() => Promise) | undefined, event: GestureResponderEvent | MouseEvent) => { - if (Navigation.getActiveRoute() !== '/settings') { + if (!Navigation.getActiveRoute().includes(ROUTES.SETTINGS)) { return; }