Merge pull request #2015 from hovoodd/change-username

Added additional check for `usernameCanBeUpdated` condition in profile
This commit is contained in:
Kim Gardner
2018-10-23 17:47:37 +01:00
committed by GitHub
@@ -178,10 +178,12 @@ class Profile extends React.Component {
},
},
notify,
success: hasChangedUsername,
} = this.props;
const { editing, formData, showDialog } = this.state;
const usernameCanBeUpdated = canUsernameBeUpdated(status);
const usernameCanBeUpdated =
canUsernameBeUpdated(status) && !hasChangedUsername;
return (
<section
@@ -307,6 +309,7 @@ Profile.propTypes = {
notify: PropTypes.func.isRequired,
username: PropTypes.string,
emailAddress: PropTypes.string,
success: PropTypes.bool.isRequired,
};
export default Profile;