Skip to content

Commit

Permalink
Merge pull request #51929 from Krishna2323/krishna2323/issue/51520
Browse files Browse the repository at this point in the history
fix: QAB - Without entering any amount, tapping submit expense/pay elsewhere shows diff. behavior.
  • Loading branch information
Gonals authored Nov 6, 2024
2 parents 573162f + fec877a commit 163e0b5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pages/iou/request/step/IOURequestStepAmount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -178,6 +179,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 ?? '',
Expand Down Expand Up @@ -206,6 +208,7 @@ function IOURequestStepAmount({
return;
}
if (iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.REQUEST) {
playSound(SOUNDS.DONE);
IOU.requestMoney(
report,
backendAmount,
Expand All @@ -222,6 +225,7 @@ function IOURequestStepAmount({
return;
}
if (iouType === CONST.IOU.TYPE.TRACK) {
playSound(SOUNDS.DONE);
IOU.trackExpense(
report,
backendAmount,
Expand Down
3 changes: 3 additions & 0 deletions src/pages/iou/request/step/IOURequestStepDistance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -307,6 +308,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,
Expand Down Expand Up @@ -337,6 +339,7 @@ function IOURequestStepDistance({
return;
}

playSound(SOUNDS.DONE);
IOU.createDistanceRequest(
report,
participants,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 ?? '',
Expand All @@ -318,6 +320,7 @@ function IOURequestStepScan({
if (locationPermissionGranted) {
getCurrentPosition(
(successData) => {
playSound(SOUNDS.DONE);
if (iouType === CONST.IOU.TYPE.TRACK && report) {
IOU.trackExpense(
report,
Expand Down Expand Up @@ -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);
},
{
Expand All @@ -383,6 +387,7 @@ function IOURequestStepScan({
);
return;
}
playSound(SOUNDS.DONE);
createTransaction(receipt, participant);
return;
}
Expand Down
5 changes: 5 additions & 0 deletions src/pages/iou/request/step/IOURequestStepScan/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 ?? '',
Expand All @@ -351,6 +353,7 @@ function IOURequestStepScan({
if (locationPermissionGranted) {
getCurrentPosition(
(successData) => {
playSound(SOUNDS.DONE);
if (iouType === CONST.IOU.TYPE.TRACK && report) {
IOU.trackExpense(
report,
Expand Down Expand Up @@ -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);
},
{
Expand All @@ -416,6 +420,7 @@ function IOURequestStepScan({
);
return;
}
playSound(SOUNDS.DONE);
createTransaction(receipt, participant);
return;
}
Expand Down

0 comments on commit 163e0b5

Please sign in to comment.