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
  • Loading branch information
Beamanator authored Aug 4, 2022
2 parents 06b378d + e5758d5 commit 703c451
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 703c451

Please sign in to comment.