Add additional check for usernameCanBeUpdated condition in profile

This commit is contained in:
hovoodd
2018-10-20 22:05:32 +03:00
parent 9e511817a8
commit c0fea4821b
@@ -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;