Skip to content

Commit

Permalink
undo bad changes
Browse files Browse the repository at this point in the history
  • Loading branch information
flodnv committed Nov 23, 2023
1 parent 295ca0e commit 473a57a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/pages/settings/Wallet/WalletPage/WalletPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod
}, [shouldShowEmptyState, windowWidth]);

const getSelectedPaymentMethodID = useCallback(() => {
if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) {
if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) {
return paymentMethod.selectedPaymentMethod.bankAccountID;
}
if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD) {
Expand Down Expand Up @@ -151,12 +151,12 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod
// The delete/default menu
if (accountType) {
let formattedSelectedPaymentMethod;
if (accountType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) {
if (accountType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) {
formattedSelectedPaymentMethod = {
title: account.addressName,
icon: account.icon,
description: PaymentUtils.getPaymentMethodDescription(accountType, account),
type: CONST.PAYMENT_METHODS.BANK_ACCOUNT,
type: CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT,
};
} else if (accountType === CONST.PAYMENT_METHODS.DEBIT_CARD) {
formattedSelectedPaymentMethod = {
Expand Down Expand Up @@ -201,7 +201,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod
return;
}

if (paymentType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) {
if (paymentType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) {
BankAccounts.openPersonalBankAccountSetupView();
return;
}
Expand All @@ -227,7 +227,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod

const previousPaymentMethod = _.find(paymentMethods, (method) => method.isDefault);
const currentPaymentMethod = _.find(paymentMethods, (method) => method.methodID === paymentMethod.methodID);
if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) {
if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) {
PaymentMethods.makeDefaultPaymentMethod(paymentMethod.selectedPaymentMethod.bankAccountID, null, previousPaymentMethod, currentPaymentMethod);
} else if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD) {
PaymentMethods.makeDefaultPaymentMethod(null, paymentMethod.selectedPaymentMethod.fundID, previousPaymentMethod, currentPaymentMethod);
Expand All @@ -242,7 +242,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod
]);

const deletePaymentMethod = useCallback(() => {
if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) {
if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) {
BankAccounts.deletePaymentBankAccount(paymentMethod.selectedPaymentMethod.bankAccountID);
} else if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD) {
PaymentMethods.deletePaymentCard(paymentMethod.selectedPaymentMethod.fundID);
Expand Down Expand Up @@ -293,7 +293,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod
// We should reset selected payment method state values and close corresponding modals if the selected payment method is deleted
let shouldResetPaymentMethodData = false;

if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT && _.isEmpty(bankAccountList[paymentMethod.methodID])) {
if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT && _.isEmpty(bankAccountList[paymentMethod.methodID])) {
shouldResetPaymentMethodData = true;
} else if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD && _.isEmpty(fundList[paymentMethod.methodID])) {
shouldResetPaymentMethodData = true;
Expand All @@ -308,7 +308,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod

const shouldShowMakeDefaultButton =
!paymentMethod.isSelectedPaymentMethodDefault &&
!(paymentMethod.formattedSelectedPaymentMethod.type === CONST.PAYMENT_METHODS.BANK_ACCOUNT && paymentMethod.selectedPaymentMethod.type === CONST.BANK_ACCOUNT.TYPE.BUSINESS);
!(paymentMethod.formattedSelectedPaymentMethod.type === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT && paymentMethod.selectedPaymentMethod.type === CONST.BANK_ACCOUNT.TYPE.BUSINESS);

// Determines whether or not the modal popup is mounted from the bottom of the screen instead of the side mount on Web or Desktop screens
const isPopoverBottomMount = anchorPosition.anchorPositionTop === 0 || isSmallScreenWidth;
Expand Down Expand Up @@ -362,7 +362,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod
<KYCWall
onSuccessfulKYC={(_iouPaymentType, source) => navigateToWalletOrTransferBalancePage(source)}
onSelectPaymentMethod={(selectedPaymentMethod) => {
if (hasActivatedWallet || selectedPaymentMethod !== CONST.PAYMENT_METHODS.BANK_ACCOUNT) {
if (hasActivatedWallet || selectedPaymentMethod !== CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) {
return;
}
// To allow upgrading to a gold wallet, continue with the KYC flow after adding a bank account
Expand Down

0 comments on commit 473a57a

Please sign in to comment.