Skip to content

Commit

Permalink
Merge pull request #10043 from Expensify/beaman-fixLodashGetUsage
Browse files Browse the repository at this point in the history
[CP Stag] Fix lodashGet usage

(cherry picked from commit b6cfc63)
  • Loading branch information
mountiny authored and OSBotify committed Jul 21, 2022
1 parent 15d4e95 commit 7afc515
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/libs/DateUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
});

Expand Down
2 changes: 1 addition & 1 deletion src/libs/Navigation/AppNavigator/AuthScreens.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/pages/settings/Profile/ProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7afc515

Please sign in to comment.