@@ -344,15 +344,14 @@ function MoneyRequestConfirmationList({
344
344
const isCategoryRequired = ! ! policy ?. requiresCategory ;
345
345
346
346
useEffect ( ( ) => {
347
- if ( shouldDisplayFieldError && didConfirmSplit ) {
348
- setFormError ( 'iou.error.genericSmartscanFailureMessage' ) ;
349
- return ;
350
- }
351
-
352
347
if ( shouldDisplayFieldError && hasSmartScanFailed ) {
353
348
setFormError ( 'iou.receiptScanningFailed' ) ;
354
349
return ;
355
350
}
351
+ if ( shouldDisplayFieldError && didConfirmSplit ) {
352
+ setFormError ( 'iou.error.genericSmartscanFailureMessage' ) ;
353
+ return ;
354
+ }
356
355
// reset the form error whenever the screen gains or loses focus
357
356
setFormError ( '' ) ;
358
357
@@ -714,7 +713,21 @@ function MoneyRequestConfirmationList({
714
713
setFormError ( 'iou.error.invalidCategoryLength' ) ;
715
714
return ;
716
715
}
717
- if ( iouType !== CONST . IOU . TYPE . PAY ) {
716
+
717
+ if ( formError ) {
718
+ return ;
719
+ }
720
+
721
+ if ( iouType === CONST . IOU . TYPE . PAY ) {
722
+ if ( ! paymentMethod ) {
723
+ return ;
724
+ }
725
+
726
+ setDidConfirm ( true ) ;
727
+
728
+ Log . info ( `[IOU] Sending money via: ${ paymentMethod } ` ) ;
729
+ onSendMoney ?.( paymentMethod ) ;
730
+ } else {
718
731
// validate the amount for distance expenses
719
732
const decimals = CurrencyUtils . getCurrencyDecimals ( iouCurrencyCode ) ;
720
733
if ( isDistanceRequest && ! isDistanceRequestWithPendingRoute && ! MoneyRequestUtils . validateAmount ( String ( iouAmount ) , decimals ) ) {
@@ -731,18 +744,6 @@ function MoneyRequestConfirmationList({
731
744
playSound ( SOUNDS . DONE ) ;
732
745
setDidConfirm ( true ) ;
733
746
onConfirm ?.( selectedParticipants ) ;
734
- } else {
735
- if ( formError ) {
736
- return ;
737
- }
738
- if ( ! paymentMethod ) {
739
- return ;
740
- }
741
-
742
- setDidConfirm ( true ) ;
743
-
744
- Log . info ( `[IOU] Sending money via: ${ paymentMethod } ` ) ;
745
- onSendMoney ?.( paymentMethod ) ;
746
747
}
747
748
} ,
748
749
[
0 commit comments