diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 3aaf22887757..2767abf30d72 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -414,7 +414,7 @@ function fetchChatReportsByIDs(chatList, shouldRedirectIfInaccessible = false) { // Fetch the personal details if there are any PersonalDetails.getFromReportParticipants(_.values(simplifiedReports)); - return fetchedReports; + return simplifiedReports; }) .catch((err) => { if (err.message !== CONST.REPORT.ERROR.INACCESSIBLE_REPORT) { @@ -907,7 +907,8 @@ function fetchOrCreateChatReport(participants, shouldNavigate = true) { } // Merge report into Onyx - Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${data.reportID}`, {reportID: data.reportID}); + const simplifiedReportObject = getSimplifiedReportObject(data); + Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${data.reportID}`, simplifiedReportObject); if (shouldNavigate) { // Redirect the logged in person to the new report @@ -916,7 +917,7 @@ function fetchOrCreateChatReport(participants, shouldNavigate = true) { // We are returning an array with a report object here since fetchAllReports calls this method or // fetchChatReportsByIDs which returns an array of report objects. - return [data]; + return [simplifiedReportObject]; }); }