Skip to content

Commit

Permalink
Merge pull request #10231 from Expensify/beaman-fixTimezoneNotRerende…
Browse files Browse the repository at this point in the history
…ring

Fix timezone not showing correct timezone after save

(cherry picked from commit 703c451)
  • Loading branch information
Beamanator authored and OSBotify committed Aug 4, 2022
1 parent 98604fe commit 443c5ec
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/libs/actions/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,14 @@ function setUpPoliciesAndNavigate(session, currentPath) {

function openProfile() {
const oldTimezoneData = myPersonalDetails.timezone || {};
const newTimezoneData = {
automatic: lodashGet(oldTimezoneData, 'automatic', true),
selected: moment.tz.guess(true),
};
let newTimezoneData = oldTimezoneData;

if (lodashGet(oldTimezoneData, 'automatic', true)) {
newTimezoneData = {
automatic: true,
selected: moment.tz.guess(true),
};
}

API.write('OpenProfile', {
timezone: JSON.stringify(newTimezoneData),
Expand Down

0 comments on commit 443c5ec

Please sign in to comment.