Sync username with store

This commit is contained in:
Chi Vinh Le
2017-05-26 21:38:29 +07:00
parent d4569b5f51
commit 7b6b46f3e5
@@ -30,6 +30,16 @@ class ChangeUsernameContainer extends React.Component {
};
}
componentWillReceiveProps(next) {
if (!this.props.auth.showCreateUsernameDialog && next.auth.showCreateUsernameDialog) {
this.setState({
formData: {
username: (this.props.auth.user && this.props.auth.user.username) || '',
},
});
}
}
handleChange = e => {
const {name, value} = e.target;
this.setState(