From b126f08c395e317ac1bb0ebb036fdb711fc51adc Mon Sep 17 00:00:00 2001 From: burczu Date: Thu, 1 Jun 2023 12:26:45 +0200 Subject: [PATCH 1/2] switch to personalDetailsList in the App action file --- src/libs/actions/App.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index e2d49f11c69e..db9e6126d12b 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -17,12 +17,10 @@ import getCurrentUrl from '../Navigation/currentUrl'; import * as Session from './Session'; let currentUserAccountID; -let currentUserEmail = ''; Onyx.connect({ key: ONYXKEYS.SESSION, callback: (val) => { currentUserAccountID = lodashGet(val, 'accountID', ''); - currentUserEmail = lodashGet(val, 'email', ''); }, }); @@ -35,15 +33,15 @@ Onyx.connect({ let myPersonalDetails; Onyx.connect({ - key: ONYXKEYS.PERSONAL_DETAILS, + key: ONYXKEYS.PERSONAL_DETAILS_LIST, callback: (val) => { - if (!val || !currentUserEmail) { + if (!val || !currentUserAccountID) { return; } - myPersonalDetails = val[currentUserEmail]; - }, -}); + myPersonalDetails = val[currentUserAccountID]; + } +}) let allPolicies = []; Onyx.connect({ @@ -294,9 +292,9 @@ function openProfile() { optimisticData: [ { onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.PERSONAL_DETAILS, + key: ONYXKEYS.PERSONAL_DETAILS_LIST, value: { - [currentUserEmail]: { + [currentUserAccountID]: { timezone: newTimezoneData, }, }, @@ -305,9 +303,9 @@ function openProfile() { failureData: [ { onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.PERSONAL_DETAILS, + key: ONYXKEYS.PERSONAL_DETAILS_LIST, value: { - [currentUserEmail]: { + [currentUserAccountID]: { timezone: oldTimezoneData, }, }, From 148e6b14a9d485500b7ec7b8edd2e68dd3064e3e Mon Sep 17 00:00:00 2001 From: burczu Date: Mon, 5 Jun 2023 08:52:06 +0200 Subject: [PATCH 2/2] prettier fixes applied --- src/libs/actions/App.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index db9e6126d12b..b3bae87fdfed 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -40,8 +40,8 @@ Onyx.connect({ } myPersonalDetails = val[currentUserAccountID]; - } -}) + }, +}); let allPolicies = []; Onyx.connect({