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 13920d1c6dd4..8886dd28935c 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.js +++ b/src/libs/Navigation/AppNavigator/AuthScreens.js @@ -60,7 +60,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 ddd59b58d105..b2583dc7f2bd 100755 --- a/src/pages/settings/Profile/ProfilePage.js +++ b/src/pages/settings/Profile/ProfilePage.js @@ -76,8 +76,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,