Skip to content

Commit 899d71c

Browse files
committed
Fix 'Pay with personal account' label to show 'Pay with wallet' when user has a linked bank account
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
1 parent b1b6e6c commit 899d71c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/hooks/usePaymentOptions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,14 @@ function usePaymentOptions({
115115
const isInvoiceReport = (!isEmptyObject(iouReport) && isInvoiceReportUtil(iouReport)) || false;
116116
const shouldShowPayWithExpensifyOption = !shouldHidePaymentOptions;
117117
const shouldShowPayElsewhereOption = !shouldHidePaymentOptions && !isInvoiceReport;
118+
const hasPersonalBankAccount = Object.values(bankAccountList).some((account) => account.accountData?.type === CONST.BANK_ACCOUNT.TYPE.PERSONAL);
118119
const paymentButtonOptions = useMemo(() => {
119120
const buttonOptions = [];
120121
const isExpenseReport = isExpenseReportUtil(iouReport);
121122
const paymentMethods = {
122123
[CONST.IOU.PAYMENT_TYPE.EXPENSIFY]: {
123-
text: hasActivatedWallet ? translate('iou.settleWallet', '') : translate('iou.settlePersonal', ''),
124-
icon: icons.User,
124+
text: hasActivatedWallet || hasPersonalBankAccount ? translate('iou.settleWallet', '') : translate('iou.settlePersonal', ''),
125+
icon: hasPersonalBankAccount ? icons.Wallet : icons.User,
125126
value: CONST.IOU.PAYMENT_TYPE.EXPENSIFY,
126127
},
127128
[CONST.IOU.PAYMENT_TYPE.VBBA]: {

0 commit comments

Comments
 (0)