From a193424aaed9f9348be8c85c2b753e2601842e23 Mon Sep 17 00:00:00 2001 From: maftalion Date: Mon, 22 Mar 2021 18:49:22 -0700 Subject: [PATCH] clarify disabled value --- src/pages/settings/ProfilePage.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/settings/ProfilePage.js b/src/pages/settings/ProfilePage.js index 813ae55e0ddd..1939a775de77 100644 --- a/src/pages/settings/ProfilePage.js +++ b/src/pages/settings/ProfilePage.js @@ -129,14 +129,17 @@ class ProfilePage extends Component { } render() { + // Determines if the pronouns/selected pronouns have changed + const arePronounsUnchanged = this.props.myPersonalDetails.pronouns === this.state.pronouns + || (this.props.myPersonalDetails.pronouns + && this.props.myPersonalDetails.pronouns === this.state.selfSelectedPronouns); + // Disables button if none of the form values have changed const isButtonDisabled = (this.props.myPersonalDetails.firstName === this.state.firstName) && (this.props.myPersonalDetails.lastName === this.state.lastName) && (this.props.myPersonalDetails.timezone.selected === this.state.selectedTimezone) && (this.props.myPersonalDetails.timezone.automatic === this.state.isAutomaticTimezone) - && (this.props.myPersonalDetails.pronouns === this.state.pronouns - || (this.props.myPersonalDetails.pronouns - && this.props.myPersonalDetails.pronouns === this.state.selfSelectedPronouns)); + && arePronounsUnchanged; return (