diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 91128ac89178..d2f85362baf8 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -725,11 +725,6 @@ function openReport( key: ONYXKEYS.PERSONAL_DETAILS_LIST, value: settledPersonalDetails, }); - failureData.push({ - onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.PERSONAL_DETAILS_LIST, - value: settledPersonalDetails, - }); // Add the createdReportActionID parameter to the API call parameters.createdReportActionID = optimisticCreatedAction.reportActionID; @@ -1943,6 +1938,16 @@ function deleteReport(reportID: string) { Onyx.multiSet(onyxData); + // Clear the optimistic personal detail + const participantPersonalDetails: OnyxCollection = {}; + report?.participantAccountIDs?.forEach((accountID) => { + if (!allPersonalDetails?.[accountID]?.isOptimisticPersonalDetail) { + return; + } + participantPersonalDetails[accountID] = null; + }); + Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, participantPersonalDetails); + // Delete linked IOU report if (report?.iouReportID) { deleteReport(report.iouReportID); diff --git a/src/pages/home/report/ReportActionItemCreated.tsx b/src/pages/home/report/ReportActionItemCreated.tsx index 899575a9aa3a..ede654adf3ce 100644 --- a/src/pages/home/report/ReportActionItemCreated.tsx +++ b/src/pages/home/report/ReportActionItemCreated.tsx @@ -117,6 +117,7 @@ export default withOnyx