File tree Expand file tree Collapse file tree
src/components/ReportActionItem Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -205,6 +205,14 @@ function MoneyRequestReceiptView({
205205
206206 const [ showConfirmDismissReceiptError , setShowConfirmDismissReceiptError ] = useState ( false ) ;
207207
208+ const transactionAndReportActionErrors = useMemo (
209+ ( ) => ( {
210+ ...transaction ?. errors ,
211+ ...parentReportAction ?. errors ,
212+ } ) ,
213+ [ transaction ?. errors , parentReportAction ?. errors ] ,
214+ ) ;
215+
208216 const dismissReceiptError = useCallback ( ( ) => {
209217 if ( ! report ?. reportID ) {
210218 return ;
@@ -227,8 +235,10 @@ function MoneyRequestReceiptView({
227235 clearAllRelatedReportActionErrors ( report . reportID , parentReportAction ) ;
228236 return ;
229237 }
230- if ( ! isEmptyObject ( errorsWithoutReportCreation ) ) {
238+ if ( ! isEmptyObject ( transactionAndReportActionErrors ) ) {
231239 revert ( transaction , getLastModifiedExpense ( report ?. reportID ) ) ;
240+ }
241+ if ( ! isEmptyObject ( errorsWithoutReportCreation ) ) {
232242 clearError ( transaction . transactionID ) ;
233243 clearAllRelatedReportActionErrors ( report . reportID , parentReportAction ) ;
234244 }
You can’t perform that action at this time.
0 commit comments