From c71d193d96c43d4ec46808c18a4c0aac97513ea3 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Mon, 28 Mar 2022 19:14:00 -0700 Subject: [PATCH 1/2] Remove extra concierge CreateChatReport call --- src/libs/actions/Report.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 3aaf22887757..fa3c92fd72d2 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) { @@ -916,7 +916,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 [getSimplifiedReportObject(data)]; }); } From 8868ad21c12617b60dee6167b61e046e0016193f Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Tue, 29 Mar 2022 12:04:15 -0700 Subject: [PATCH 2/2] Merge simplified report object into Onyx --- src/libs/actions/Report.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index fa3c92fd72d2..2767abf30d72 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -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 [getSimplifiedReportObject(data)]; + return [simplifiedReportObject]; }); }