From 35dd91d1cce09ae3bd998eccde28ace5af279bad Mon Sep 17 00:00:00 2001 From: Gandalf Date: Fri, 30 Aug 2024 19:25:35 +0530 Subject: [PATCH 1/4] fix app freeze --- src/pages/settings/Wallet/WalletPage/WalletPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.tsx b/src/pages/settings/Wallet/WalletPage/WalletPage.tsx index 7e242a5c8782..bbb4ae392f02 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.tsx +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.tsx @@ -20,6 +20,7 @@ import ScreenWrapper from '@components/ScreenWrapper'; import ScrollView from '@components/ScrollView'; import Section from '@components/Section'; import Text from '@components/Text'; +import * as Modal from '@userActions/Modal'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; @@ -576,7 +577,7 @@ function WalletPage({bankAccountList = {}, cardList = {}, fundList = {}, isLoadi setShowConfirmDeleteModal(true)} + onPress={() => Modal.close(() =>setShowConfirmDeleteModal(true))} wrapperStyle={[styles.pv3, styles.ph5, !shouldUseNarrowLayout ? styles.sidebarPopover : {}]} /> From cfd8d7286d274f57e1fe1e4a984d72fb07c487d2 Mon Sep 17 00:00:00 2001 From: Gandalf Date: Fri, 30 Aug 2024 19:27:18 +0530 Subject: [PATCH 2/4] fix prettier --- src/pages/settings/Wallet/WalletPage/WalletPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.tsx b/src/pages/settings/Wallet/WalletPage/WalletPage.tsx index bbb4ae392f02..d233dd16b48e 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.tsx +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.tsx @@ -20,7 +20,6 @@ import ScreenWrapper from '@components/ScreenWrapper'; import ScrollView from '@components/ScrollView'; import Section from '@components/Section'; import Text from '@components/Text'; -import * as Modal from '@userActions/Modal'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; @@ -35,6 +34,7 @@ import PaymentMethodList from '@pages/settings/Wallet/PaymentMethodList'; import WalletEmptyState from '@pages/settings/Wallet/WalletEmptyState'; import variables from '@styles/variables'; import * as BankAccounts from '@userActions/BankAccounts'; +import * as Modal from '@userActions/Modal'; import * as PaymentMethods from '@userActions/PaymentMethods'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -577,7 +577,7 @@ function WalletPage({bankAccountList = {}, cardList = {}, fundList = {}, isLoadi Modal.close(() =>setShowConfirmDeleteModal(true))} + onPress={() => Modal.close(() => setShowConfirmDeleteModal(true))} wrapperStyle={[styles.pv3, styles.ph5, !shouldUseNarrowLayout ? styles.sidebarPopover : {}]} /> From 9be17c530d7ace03c70872bfd14357ad9b3bd4c0 Mon Sep 17 00:00:00 2001 From: Gandalf Date: Fri, 30 Aug 2024 21:47:58 +0530 Subject: [PATCH 3/4] bring confirm modal outside popover --- src/pages/settings/Wallet/WalletPage/WalletPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.tsx b/src/pages/settings/Wallet/WalletPage/WalletPage.tsx index d233dd16b48e..a68405931911 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.tsx +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.tsx @@ -582,7 +582,8 @@ function WalletPage({bankAccountList = {}, cardList = {}, fundList = {}, isLoadi /> )} - + { deletePaymentMethod(); @@ -597,7 +598,6 @@ function WalletPage({bankAccountList = {}, cardList = {}, fundList = {}, isLoadi danger onModalHide={resetSelectedPaymentMethodData} /> - )} Date: Fri, 30 Aug 2024 22:03:09 +0530 Subject: [PATCH 4/4] fix lint --- .../settings/Wallet/WalletPage/WalletPage.tsx | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.tsx b/src/pages/settings/Wallet/WalletPage/WalletPage.tsx index a68405931911..03b69a8f73ab 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.tsx +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.tsx @@ -584,20 +584,20 @@ function WalletPage({bankAccountList = {}, cardList = {}, fundList = {}, isLoadi )} { - deletePaymentMethod(); - hideDefaultDeleteMenu(); - }} - onCancel={hideDefaultDeleteMenu} - title={translate('walletPage.deleteAccount')} - prompt={translate('walletPage.deleteConfirmation')} - confirmText={translate('common.delete')} - cancelText={translate('common.cancel')} - shouldShowCancelButton - danger - onModalHide={resetSelectedPaymentMethodData} - /> + isVisible={showConfirmDeleteModal} + onConfirm={() => { + deletePaymentMethod(); + hideDefaultDeleteMenu(); + }} + onCancel={hideDefaultDeleteMenu} + title={translate('walletPage.deleteAccount')} + prompt={translate('walletPage.deleteConfirmation')} + confirmText={translate('common.delete')} + cancelText={translate('common.cancel')} + shouldShowCancelButton + danger + onModalHide={resetSelectedPaymentMethodData} + /> )}