Skip to content

Commit

Permalink
Merge pull request Expensify#53129 from bernhardoj/fix/52792-missing-…
Browse files Browse the repository at this point in the history
…sound-when-pay-invoice

Fix missing sound when pay invoice
  • Loading branch information
mountiny authored Dec 3, 2024
2 parents d89e4a9 + 290ef87 commit a1e710e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/components/ProcessMoneyReportHoldMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import Navigation from '@libs/Navigation/Navigation';
import {isLinkedTransactionHeld} from '@libs/ReportActionsUtils';
import playSound, {SOUNDS} from '@libs/Sound';
import * as IOU from '@userActions/IOU';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
Expand Down Expand Up @@ -75,7 +74,6 @@ function ProcessMoneyReportHoldMenu({
if (startAnimation) {
startAnimation();
}
playSound(SOUNDS.SUCCESS);
IOU.payMoneyRequest(paymentType, chatReport, moneyRequestReport, full);
}
onClose();
Expand Down
4 changes: 0 additions & 4 deletions src/components/SettlementButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import useNetwork from '@hooks/useNetwork';
import Navigation from '@libs/Navigation/Navigation';
import getPolicyEmployeeAccountIDs from '@libs/PolicyEmployeeListUtils';
import * as ReportUtils from '@libs/ReportUtils';
import playSound, {SOUNDS} from '@libs/Sound';
import * as SubscriptionUtils from '@libs/SubscriptionUtils';
import * as BankAccounts from '@userActions/BankAccounts';
import * as IOU from '@userActions/IOU';
Expand Down Expand Up @@ -213,9 +212,6 @@ function SettlementButton({
return;
}

if (!ReportUtils.hasHeldExpenses(iouReport?.reportID)) {
playSound(SOUNDS.SUCCESS);
}
onPress(iouPaymentType);
};

Expand Down
3 changes: 3 additions & 0 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import * as ReportConnection from '@libs/ReportConnection';
import type {OptimisticChatReport, OptimisticCreatedReportAction, OptimisticIOUReportAction, TransactionDetails} from '@libs/ReportUtils';
import * as ReportUtils from '@libs/ReportUtils';
import * as SessionUtils from '@libs/SessionUtils';
import playSound, {SOUNDS} from '@libs/Sound';
import * as SubscriptionUtils from '@libs/SubscriptionUtils';
import * as TransactionUtils from '@libs/TransactionUtils';
import {getTransaction} from '@libs/TransactionUtils';
Expand Down Expand Up @@ -7622,6 +7623,7 @@ function payMoneyRequest(paymentType: PaymentMethodType, chatReport: OnyxTypes.R
// Expensify Wallets.
const apiCommand = paymentType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY ? WRITE_COMMANDS.PAY_MONEY_REQUEST_WITH_WALLET : WRITE_COMMANDS.PAY_MONEY_REQUEST;

playSound(SOUNDS.SUCCESS);
API.write(apiCommand, params, {optimisticData, successData, failureData});
}

Expand Down Expand Up @@ -7670,6 +7672,7 @@ function payInvoice(paymentMethodType: PaymentMethodType, chatReport: OnyxTypes.
};
}

playSound(SOUNDS.SUCCESS);
API.write(WRITE_COMMANDS.PAY_INVOICE, params, {optimisticData, successData, failureData});
}

Expand Down

0 comments on commit a1e710e

Please sign in to comment.