Skip to content
Merged
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
6 changes: 5 additions & 1 deletion src/pages/iou/request/step/IOURequestStepMerchant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ function IOURequestStepMerchant({
shouldNavigateAfterSaveRef.current = true;
return;
}
setMoneyRequestMerchant(transactionID, newMerchant || CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, !isEditing, hasReceipt(transaction));
// updateMoneyRequestMerchant's optimisticData already sets merchant on TRANSACTION{id},
// also calling setMoneyRequestMerchant would trigger a redundant Onyx commit and
// re-render every subscriber of that key for nothing.
if (isEditing) {
updateMoneyRequestMerchant({
transactionID,
Expand All @@ -139,6 +141,8 @@ function IOURequestStepMerchant({
isASAPSubmitBetaEnabled,
parentReportNextStep,
});
} else {
setMoneyRequestMerchant(transactionID, newMerchant || CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, true, hasReceipt(transaction));
}
setIsSaved(true);
shouldNavigateAfterSaveRef.current = true;
Expand Down
Loading