Skip to content

Commit

Permalink
Merge pull request #24355 from StevenKKC/fixDuplicateContacts
Browse files Browse the repository at this point in the history
fix:21706 remove optimistic user info from personal details list
  • Loading branch information
bondydaa committed Aug 17, 2023
2 parents b39daa3 + b6f16c3 commit 7162c96
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p

// Add optimistic personal details for new participants
const optimisticPersonalDetails = {};
const failurePersonalDetails = {};
const settledPersonalDetails = {};
_.map(participantLoginList, (login, index) => {
const accountID = newReportObject.participantAccountIDs[index];
optimisticPersonalDetails[accountID] = allPersonalDetails[accountID] || {
Expand All @@ -483,18 +483,23 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p
isOptimisticPersonalDetail: true,
};

failurePersonalDetails[accountID] = allPersonalDetails[accountID] || null;
settledPersonalDetails[accountID] = allPersonalDetails[accountID] || null;
});
onyxData.optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
value: optimisticPersonalDetails,
});

onyxData.successData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
value: settledPersonalDetails,
});
onyxData.failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
value: failurePersonalDetails,
value: settledPersonalDetails,
});

// Add the createdReportActionID parameter to the API call
Expand Down

0 comments on commit 7162c96

Please sign in to comment.