Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ export default {
genericSmartscanFailureMessage: 'Transaction is missing fields',
atLeastTwoDifferentWaypoints: 'Please enter at least two different addresses',
splitBillMultipleParticipantsErrorMessage: 'Split bill is only allowed between a single workspace or individual users. Please update your selection.',
invalidMerchant: 'Please enter a corrent merchant.',
invalidMerchant: 'Please enter a correct merchant.',
},
waitingOnEnabledWallet: ({submitterDisplayName}: WaitingOnBankAccountParams) => `Started settling up, payment is held until ${submitterDisplayName} enables their Wallet`,
enableWallet: 'Enable Wallet',
Expand Down
10 changes: 7 additions & 3 deletions src/pages/EditRequestPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,21 @@ function EditRequestPage({report, route, parentReport, policyCategories, policyT
defaultMerchant={transactionMerchant}
isPolicyExpenseChat={isPolicyExpenseChat}
onSubmit={(transactionChanges) => {
const newTrimmedMerchant = transactionChanges.merchant.trim();

// In case the merchant hasn't been changed, do not make the API request.
if (transactionChanges.merchant.trim() === transactionMerchant) {
// In case the merchant has been set to empty string while current merchant is partial, do nothing too.
if (newTrimmedMerchant === transactionMerchant || (newTrimmedMerchant === '' && transactionMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT)) {
Navigation.dismissModal();
return;
}

// This is possible only in case of IOU requests.
if (transactionChanges.merchant.trim() === '') {
if (newTrimmedMerchant === '') {
editMoneyRequest({merchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT});
return;
}
editMoneyRequest({merchant: transactionChanges.merchant.trim()});
editMoneyRequest({merchant: newTrimmedMerchant});
}}
/>
);
Expand Down