Skip to content

Commit da06c01

Browse files
committed
Remove duplicate useEffect dependency in AddPaymentMethodMenu
1 parent b2b39fa commit da06c01

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/components/AddPaymentMethodMenu.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,17 @@ function AddPaymentMethodMenu({
7575

7676
const isPersonalOnlyOption = canUsePersonalBankAccount && !canUseBusinessBankAccount;
7777

78+
const isLoadingIntroSelected = isLoadingOnyxValue(introSelectedStatus);
79+
7880
// We temporarily disabled P2P debit cards so we will automatically select the personal bank account option if there is no other option to select.
7981
useEffect(() => {
80-
if (!isVisible || !isPersonalOnlyOption || isLoadingOnyxValue(introSelectedStatus)) {
82+
if (!isVisible || !isPersonalOnlyOption || isLoadingIntroSelected) {
8183
return;
8284
}
8385

8486
completePaymentOnboarding(CONST.PAYMENT_SELECTED.PBA, introSelected, isSelfTourViewed, betas);
8587
onItemSelected(CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT);
86-
}, [betas, introSelected, introSelectedStatus, introSelectedStatus.status, isPersonalOnlyOption, isVisible, onItemSelected, isSelfTourViewed]);
88+
}, [betas, introSelected, isLoadingIntroSelected, isPersonalOnlyOption, isVisible, onItemSelected, isSelfTourViewed]);
8789

8890
if (isPersonalOnlyOption) {
8991
return null;

0 commit comments

Comments
 (0)