From 52bdf3c2bb7aa2870ff791c4ae0cc4881776a131 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 11 Jul 2023 10:23:20 +0700 Subject: [PATCH] remove invalid user from contact list --- src/libs/actions/Report.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index efe1ebe2bd91..970729d040e2 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -442,6 +442,7 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p // Add optimistic personal details for new participants const optimisticPersonalDetails = {}; + const failurePersonalDetails = {}; _.map(participantLoginList, (login, index) => { const accountID = newReportObject.participantAccountIDs[index]; optimisticPersonalDetails[accountID] = allPersonalDetails[accountID] || { @@ -450,6 +451,8 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p avatar: UserUtils.getDefaultAvatarURL(accountID), displayName: login, }; + + failurePersonalDetails[accountID] = allPersonalDetails[accountID] || null; }); onyxData.optimisticData.push({ onyxMethod: Onyx.METHOD.MERGE, @@ -457,6 +460,12 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p value: optimisticPersonalDetails, }); + onyxData.failureData.push({ + onyxMethod: Onyx.METHOD.MERGE, + key: ONYXKEYS.PERSONAL_DETAILS_LIST, + value: failurePersonalDetails, + }); + // Add the createdReportActionID parameter to the API call params.createdReportActionID = optimisticCreatedAction.reportActionID;