Skip to content

Commit

Permalink
set initial pronouns
Browse files Browse the repository at this point in the history
  • Loading branch information
Maftalion committed Mar 15, 2021
1 parent 41083e5 commit b0c0063
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/pages/settings/ProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,26 @@ class ProfilePage extends Component {
const {
firstName, lastName, pronouns, timezone = {},
} = props.myPersonalDetails;
const pronounValues = Object.values(CONST.PRONOUNS);

let initialPronouns = pronouns;
let initialSelfSelectedPronouns = '';

if (pronouns && !pronounValues.includes(pronouns)) {
initialPronouns = CONST.PRONOUNS.SELF_SELECT;
initialSelfSelectedPronouns = pronouns;
}

this.state = {
firstName,
lastName,
pronouns,
selfSelectedPronouns: '',
pronouns: initialPronouns,
selfSelectedPronouns: initialSelfSelectedPronouns,
selectedTimezone: timezone.selected ?? CONST.DEFAULT_TIME_ZONE.selected,
isAutomaticTimezone: timezone.automatic ?? CONST.DEFAULT_TIME_ZONE.automatic,
};

this.pronounDropdownValues = Object.values(pronounsMap).map(pronoun => ({value: pronoun, label: pronoun}));
this.pronounDropdownValues = pronounValues.map(pronoun => ({value: pronoun, label: pronoun}));
this.updatePersonalDetails = this.updatePersonalDetails.bind(this);
}

Expand Down

0 comments on commit b0c0063

Please sign in to comment.