Skip to content

Commit

Permalink
Merge pull request #35881 from bernhardoj/fix/35175-split-error-messa…
Browse files Browse the repository at this point in the history
…ge-prioritization

Fix required fields error message shows only after pressing the split button the 2nd time
  • Loading branch information
Beamanator authored Feb 12, 2024
2 parents 06c7dac + 80111ce commit 4bb42fa
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,14 @@ function MoneyRequestConfirmationList(props) {
const shouldDisplayMerchantError = props.isPolicyExpenseChat && !props.isScanRequest && isMerchantEmpty;

useEffect(() => {
if (shouldDisplayFieldError && props.hasSmartScanFailed) {
setFormError('iou.receiptScanningFailed');
return;
}
if (shouldDisplayFieldError && didConfirmSplit) {
setFormError('iou.error.genericSmartscanFailureMessage');
return;
}
if (shouldDisplayFieldError && props.hasSmartScanFailed) {
setFormError('iou.receiptScanningFailed');
return;
}
// reset the form error whenever the screen gains or loses focus
setFormError('');
}, [isFocused, transaction, shouldDisplayFieldError, props.hasSmartScanFailed, didConfirmSplit]);
Expand Down Expand Up @@ -497,7 +497,6 @@ function MoneyRequestConfirmationList(props) {

if (props.isEditingSplitBill && TransactionUtils.areRequiredFieldsEmpty(transaction)) {
setDidConfirmSplit(true);
setFormError('iou.error.genericSmartscanFailureMessage');
return;
}

Expand Down

0 comments on commit 4bb42fa

Please sign in to comment.