From 6c902fe3b993aa9b23600c71256ec6e692d00bac Mon Sep 17 00:00:00 2001 From: Steven KKC Date: Thu, 10 Aug 2023 03:40:55 -0400 Subject: [PATCH 1/3] remove optimistic user info from personal details list --- src/libs/actions/Report.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 2ac014e22a13..b4ba7b707057 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -472,7 +472,7 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p // Add optimistic personal details for new participants const optimisticPersonalDetails = {}; - const failurePersonalDetails = {}; + const removalPersonalDetails = {}; _.map(participantLoginList, (login, index) => { const accountID = newReportObject.participantAccountIDs[index]; optimisticPersonalDetails[accountID] = allPersonalDetails[accountID] || { @@ -483,7 +483,7 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p isOptimisticPersonalDetail: true, }; - failurePersonalDetails[accountID] = allPersonalDetails[accountID] || null; + removalPersonalDetails[accountID] = allPersonalDetails[accountID] || null; }); onyxData.optimisticData.push({ onyxMethod: Onyx.METHOD.MERGE, @@ -491,10 +491,15 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p value: optimisticPersonalDetails, }); + onyxData.successData.push({ + onyxMethod: Onyx.METHOD.MERGE, + key: ONYXKEYS.PERSONAL_DETAILS_LIST, + value: removalPersonalDetails, + }); onyxData.failureData.push({ onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.PERSONAL_DETAILS_LIST, - value: failurePersonalDetails, + value: removalPersonalDetails, }); // Add the createdReportActionID parameter to the API call From abfe7109f772ee5d5982a4739b6d03bd2672f7a3 Mon Sep 17 00:00:00 2001 From: Steven KKC Date: Fri, 11 Aug 2023 09:42:44 -0400 Subject: [PATCH 2/3] rename variables --- src/libs/actions/Report.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index b4ba7b707057..2b63b997d89c 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -472,7 +472,7 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p // Add optimistic personal details for new participants const optimisticPersonalDetails = {}; - const removalPersonalDetails = {}; + const settledPersonalDetails = {}; _.map(participantLoginList, (login, index) => { const accountID = newReportObject.participantAccountIDs[index]; optimisticPersonalDetails[accountID] = allPersonalDetails[accountID] || { @@ -483,7 +483,7 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p isOptimisticPersonalDetail: true, }; - removalPersonalDetails[accountID] = allPersonalDetails[accountID] || null; + settledPersonalDetails [accountID] = allPersonalDetails[accountID] || null; }); onyxData.optimisticData.push({ onyxMethod: Onyx.METHOD.MERGE, @@ -494,12 +494,12 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p onyxData.successData.push({ onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.PERSONAL_DETAILS_LIST, - value: removalPersonalDetails, + value: settledPersonalDetails , }); onyxData.failureData.push({ onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.PERSONAL_DETAILS_LIST, - value: removalPersonalDetails, + value: settledPersonalDetails , }); // Add the createdReportActionID parameter to the API call From b6f16c3ba686464f7210cb58bb2503e8ebff2e21 Mon Sep 17 00:00:00 2001 From: Steven KKC Date: Fri, 11 Aug 2023 14:03:22 -0400 Subject: [PATCH 3/3] fix lint error --- src/libs/actions/Report.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 2b63b997d89c..d2450d0600c5 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -472,7 +472,7 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p // Add optimistic personal details for new participants const optimisticPersonalDetails = {}; - const settledPersonalDetails = {}; + const settledPersonalDetails = {}; _.map(participantLoginList, (login, index) => { const accountID = newReportObject.participantAccountIDs[index]; optimisticPersonalDetails[accountID] = allPersonalDetails[accountID] || { @@ -483,7 +483,7 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p isOptimisticPersonalDetail: true, }; - settledPersonalDetails [accountID] = allPersonalDetails[accountID] || null; + settledPersonalDetails[accountID] = allPersonalDetails[accountID] || null; }); onyxData.optimisticData.push({ onyxMethod: Onyx.METHOD.MERGE, @@ -494,12 +494,12 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p onyxData.successData.push({ onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.PERSONAL_DETAILS_LIST, - value: settledPersonalDetails , + value: settledPersonalDetails, }); onyxData.failureData.push({ onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.PERSONAL_DETAILS_LIST, - value: settledPersonalDetails , + value: settledPersonalDetails, }); // Add the createdReportActionID parameter to the API call