diff --git a/src/libs/DateUtils.js b/src/libs/DateUtils.js index 522b2500a519..1f02c98657db 100644 --- a/src/libs/DateUtils.js +++ b/src/libs/DateUtils.js @@ -29,7 +29,7 @@ let timezone = CONST.DEFAULT_TIME_ZONE; Onyx.connect({ key: ONYXKEYS.PERSONAL_DETAILS, callback: (val) => { - timezone = lodashGet(val, currentUserEmail, 'timezone', CONST.DEFAULT_TIME_ZONE); + timezone = lodashGet(val, [currentUserEmail, 'timezone'], CONST.DEFAULT_TIME_ZONE); }, }); diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.js b/src/libs/Navigation/AppNavigator/AuthScreens.js index 29deef79a250..4779e0ae1ca9 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.js +++ b/src/libs/Navigation/AppNavigator/AuthScreens.js @@ -57,7 +57,7 @@ Onyx.connect({ return; } - const timezone = lodashGet(val, currentUserEmail, 'timezone', {}); + const timezone = lodashGet(val, [currentUserEmail, 'timezone'], {}); const currentTimezone = moment.tz.guess(true); // If the current timezone is different than the user's timezone, and their timezone is set to automatic diff --git a/src/pages/settings/Profile/ProfilePage.js b/src/pages/settings/Profile/ProfilePage.js index 0f99d722b5ba..0cdde430ee2c 100755 --- a/src/pages/settings/Profile/ProfilePage.js +++ b/src/pages/settings/Profile/ProfilePage.js @@ -75,8 +75,8 @@ class ProfilePage extends Component { pronouns: this.props.currentUserPersonalDetails.pronouns, hasPronounError: false, hasSelfSelectedPronouns: !_.isEmpty(this.props.currentUserPersonalDetails.pronouns) && !this.props.currentUserPersonalDetails.pronouns.startsWith(CONST.PRONOUNS.PREFIX), - selectedTimezone: lodashGet(this.props.currentUserPersonalDetails.timezone, 'selected', CONST.DEFAULT_TIME_ZONE.selected), - isAutomaticTimezone: lodashGet(this.props.currentUserPersonalDetails.timezone, 'automatic', CONST.DEFAULT_TIME_ZONE.automatic), + selectedTimezone: lodashGet(this.props.currentUserPersonalDetails, 'timezone.selected', CONST.DEFAULT_TIME_ZONE.selected), + isAutomaticTimezone: lodashGet(this.props.currentUserPersonalDetails, 'timezone.automatic', CONST.DEFAULT_TIME_ZONE.automatic), logins: this.getLogins(props.loginList), avatar: {uri: lodashGet(this.props.currentUserPersonalDetails, 'avatar', ReportUtils.getDefaultAvatar(this.props.currentUserPersonalDetails.login))}, isAvatarChanged: false,