diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index f5315f2c8006..cedbae4bf9da 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -739,11 +739,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; @@ -1889,6 +1884,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 4fe52f6adf41..5d634c95debd 100644 --- a/src/pages/home/report/ReportActionItemCreated.tsx +++ b/src/pages/home/report/ReportActionItemCreated.tsx @@ -119,6 +119,7 @@ export default withOnyx