From f3ba001e267799363f5879da19c65f6a7bb9c332 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Sun, 3 Nov 2024 03:36:56 +0530 Subject: [PATCH] fix: QAB - Without entering any amount, tapping submit expense/pay elsewhere shows diff. behavior. Signed-off-by: krishna2323 --- src/pages/iou/request/step/IOURequestStepAmount.tsx | 4 ++++ src/pages/iou/request/step/IOURequestStepDistance.tsx | 4 ++++ .../iou/request/step/IOURequestStepScan/index.native.tsx | 5 +++++ src/pages/iou/request/step/IOURequestStepScan/index.tsx | 5 +++++ 4 files changed, 18 insertions(+) diff --git a/src/pages/iou/request/step/IOURequestStepAmount.tsx b/src/pages/iou/request/step/IOURequestStepAmount.tsx index ce3d03138dde..604cd88f87b7 100644 --- a/src/pages/iou/request/step/IOURequestStepAmount.tsx +++ b/src/pages/iou/request/step/IOURequestStepAmount.tsx @@ -11,6 +11,7 @@ import * as CurrencyUtils from '@libs/CurrencyUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; import * as ReportUtils from '@libs/ReportUtils'; +import playSound, {SOUNDS} from '@libs/Sound'; import * as TransactionUtils from '@libs/TransactionUtils'; import {getRequestType} from '@libs/TransactionUtils'; import MoneyRequestAmountForm from '@pages/iou/MoneyRequestAmountForm'; @@ -195,6 +196,7 @@ function IOURequestStepAmount({ if (shouldSkipConfirmation) { // Only skip confirmation when the split is not configurable, for now Smartscanned splits cannot be configured if (iouType === CONST.IOU.TYPE.SPLIT && transaction?.iouRequestType === CONST.IOU.REQUEST_TYPE.SCAN) { + playSound(SOUNDS.DONE); IOU.splitBill({ participants, currentUserLogin: currentUserPersonalDetails.login ?? '', @@ -223,6 +225,7 @@ function IOURequestStepAmount({ return; } if (iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.REQUEST) { + playSound(SOUNDS.DONE); IOU.requestMoney( report, backendAmount, @@ -239,6 +242,7 @@ function IOURequestStepAmount({ return; } if (iouType === CONST.IOU.TYPE.TRACK) { + playSound(SOUNDS.DONE); IOU.trackExpense( report, backendAmount, diff --git a/src/pages/iou/request/step/IOURequestStepDistance.tsx b/src/pages/iou/request/step/IOURequestStepDistance.tsx index 03cffc1ec1dd..4be0eafdc55c 100644 --- a/src/pages/iou/request/step/IOURequestStepDistance.tsx +++ b/src/pages/iou/request/step/IOURequestStepDistance.tsx @@ -29,6 +29,7 @@ import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; import * as PolicyUtils from '@libs/PolicyUtils'; import * as ReportUtils from '@libs/ReportUtils'; +import playSound, {SOUNDS} from '@libs/Sound'; import * as TransactionUtils from '@libs/TransactionUtils'; import * as IOU from '@userActions/IOU'; import * as MapboxToken from '@userActions/MapboxToken'; @@ -302,6 +303,7 @@ function IOURequestStepDistance({ setDistanceRequestData(participants); if (shouldSkipConfirmation) { if (iouType === CONST.IOU.TYPE.SPLIT) { + playSound(SOUNDS.DONE); IOU.splitBill({ participants, currentUserLogin: currentUserPersonalDetails.login ?? '', @@ -323,6 +325,7 @@ function IOURequestStepDistance({ IOU.setMoneyRequestMerchant(transactionID, translate('iou.fieldPending'), false); const participant = participants.at(0); if (iouType === CONST.IOU.TYPE.TRACK && participant) { + playSound(SOUNDS.DONE); IOU.trackExpense( report, 0, @@ -353,6 +356,7 @@ function IOURequestStepDistance({ return; } + playSound(SOUNDS.DONE); IOU.createDistanceRequest( report, participants, diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx b/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx index d3f0c9cb496d..eac7fe2f1164 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx @@ -35,6 +35,7 @@ import Log from '@libs/Log'; import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; import * as ReportUtils from '@libs/ReportUtils'; +import playSound, {SOUNDS} from '@libs/Sound'; import * as TransactionUtils from '@libs/TransactionUtils'; import StepScreenWrapper from '@pages/iou/request/step/StepScreenWrapper'; import withFullTransactionOrNotFound from '@pages/iou/request/step/withFullTransactionOrNotFound'; @@ -295,6 +296,7 @@ function IOURequestStepScan({ receipt.source = source; receipt.state = CONST.IOU.RECEIPT_STATE.SCANREADY; if (iouType === CONST.IOU.TYPE.SPLIT) { + playSound(SOUNDS.DONE); IOU.startSplitBill({ participants, currentUserLogin: currentUserPersonalDetails?.login ?? '', @@ -318,6 +320,7 @@ function IOURequestStepScan({ if (locationPermissionGranted) { getCurrentPosition( (successData) => { + playSound(SOUNDS.DONE); if (iouType === CONST.IOU.TYPE.TRACK && report) { IOU.trackExpense( report, @@ -374,6 +377,7 @@ function IOURequestStepScan({ (errorData) => { Log.info('[IOURequestStepScan] getCurrentPosition failed', false, errorData); // When there is an error, the money can still be requested, it just won't include the GPS coordinates + playSound(SOUNDS.DONE); createTransaction(receipt, participant); }, { @@ -383,6 +387,7 @@ function IOURequestStepScan({ ); return; } + playSound(SOUNDS.DONE); createTransaction(receipt, participant); return; } diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.tsx b/src/pages/iou/request/step/IOURequestStepScan/index.tsx index 4ed956e5ce7e..46f2fe6262ec 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/index.tsx @@ -35,6 +35,7 @@ import Log from '@libs/Log'; import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; import * as ReportUtils from '@libs/ReportUtils'; +import playSound, {SOUNDS} from '@libs/Sound'; import * as TransactionUtils from '@libs/TransactionUtils'; import ReceiptDropUI from '@pages/iou/ReceiptDropUI'; import StepScreenDragAndDropWrapper from '@pages/iou/request/step/StepScreenDragAndDropWrapper'; @@ -328,6 +329,7 @@ function IOURequestStepScan({ receipt.source = source; receipt.state = CONST.IOU.RECEIPT_STATE.SCANREADY; if (iouType === CONST.IOU.TYPE.SPLIT) { + playSound(SOUNDS.DONE); IOU.startSplitBill({ participants, currentUserLogin: currentUserPersonalDetails?.login ?? '', @@ -351,6 +353,7 @@ function IOURequestStepScan({ if (locationPermissionGranted) { getCurrentPosition( (successData) => { + playSound(SOUNDS.DONE); if (iouType === CONST.IOU.TYPE.TRACK && report) { IOU.trackExpense( report, @@ -407,6 +410,7 @@ function IOURequestStepScan({ (errorData) => { Log.info('[IOURequestStepScan] getCurrentPosition failed', false, errorData); // When there is an error, the money can still be requested, it just won't include the GPS coordinates + playSound(SOUNDS.DONE); createTransaction(receipt, participant); }, { @@ -416,6 +420,7 @@ function IOURequestStepScan({ ); return; } + playSound(SOUNDS.DONE); createTransaction(receipt, participant); return; }