mirror of
https://github.com/wassname/talk.git
synced 2026-07-20 12:40:47 +08:00
Add additional check for usernameCanBeUpdated condition in profile
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user