Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:21706 remove optimistic user info from personal details list #24355

Merged
merged 3 commits into from
Aug 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading