File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ import {
160160 isGroupChat as isGroupChatReportUtils ,
161161 isHiddenForCurrentUser ,
162162 isIOUReportUsingReport ,
163+ isMoneyRequest ,
163164 isMoneyRequestReport ,
164165 isOpenExpenseReport ,
165166 isProcessingReport ,
@@ -1892,10 +1893,13 @@ function handlePreexistingReport(report: Report) {
18921893 }
18931894
18941895 // Handle cleanup of stale optimistic IOU report and its report preview separately
1895- if ( isMoneyRequestReport ( report ) && parentReportActionID ) {
1896- Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ parentReportID } ` , {
1897- [ parentReportActionID ] : null ,
1898- } ) ;
1896+ if ( ( isMoneyRequestReport ( report ) || isMoneyRequest ( report ) ) && parentReportID && parentReportActionID ) {
1897+ const parentReportAction = allReportActions ?. [ parentReportID ] ?. [ parentReportActionID ] ;
1898+ if ( parentReportAction ?. childReportID === reportID ) {
1899+ Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT_ACTIONS } ${ parentReportID } ` , {
1900+ [ parentReportActionID ] : null ,
1901+ } ) ;
1902+ }
18991903 Onyx . merge ( `${ ONYXKEYS . COLLECTION . REPORT } ${ reportID } ` , null ) ;
19001904 return ;
19011905 }
You can’t perform that action at this time.
0 commit comments