@@ -189,6 +189,8 @@ function requestMoney(report, amount, currency, recipientEmail, participant, com
189
189
errorFields : null ,
190
190
} ,
191
191
} ;
192
+ chatReportFailureData . value . pendingFields = { createChat : null } ;
193
+ delete chatReportFailureData . value . hasOutstandingIOU ;
192
194
chatReportFailureData . value . errorFields = {
193
195
createChat : {
194
196
[ DateUtils . getMicroseconds ( ) ] : Localize . translateLocal ( 'report.genericCreateReportFailureMessage' ) ,
@@ -198,6 +200,10 @@ function requestMoney(report, amount, currency, recipientEmail, participant, com
198
200
// Then add an optimistic created action
199
201
optimisticReportActionsData . value [ optimisticCreatedAction . reportActionID ] = optimisticCreatedAction ;
200
202
reportActionsSuccessData . value [ optimisticCreatedAction . reportActionID ] = { pendingAction : null } ;
203
+
204
+ // Failure data should feature red brick road
205
+ reportActionsFailureData . value [ optimisticCreatedAction . reportActionID ] = { pendingAction : null } ;
206
+ reportActionsFailureData . value [ optimisticReportAction . reportActionID ] = { pendingAction : CONST . RED_BRICK_ROAD_PENDING_ACTION . ADD } ;
201
207
}
202
208
203
209
const optimisticData = [
@@ -927,6 +933,9 @@ function getSendMoneyParams(report, amount, currency, comment, paymentMethodType
927
933
928
934
// Add an optimistic created action to the optimistic reportActions data
929
935
optimisticReportActionsData . value [ optimisticCreatedAction . reportActionID ] = optimisticCreatedAction ;
936
+
937
+ // If we're going to fail to create the report itself, let's not have redundant error messages for the IOU
938
+ failureData [ 0 ] . value [ optimisticIOUReportAction . reportActionID ] = { pendingAction : null } ;
930
939
}
931
940
932
941
const optimisticData = [
0 commit comments