mirror of
https://github.com/wassname/talk.git
synced 2026-07-17 11:33:39 +08:00
changes ChangeUsername
This commit is contained in:
@@ -323,7 +323,7 @@ export const checkLogin = () => (dispatch, _, {rest, client, pym, storage}) => {
|
||||
pym.sendMessage('coral-auth-changed', JSON.stringify(result.user));
|
||||
|
||||
// Display create username dialog if necessary.
|
||||
if (can(result.user, 'EDIT_NAME') && get(result.user, 'status.banned.status')) {
|
||||
if (can(result.user, 'EDIT_NAME') && !get(result.user, 'status.banned.status')) {
|
||||
dispatch(showCreateUsernameDialog());
|
||||
}
|
||||
})
|
||||
|
||||
@@ -92,12 +92,13 @@ class ChangeUsernameContainer extends React.Component {
|
||||
handleSubmitUsername = (e) => {
|
||||
e.preventDefault();
|
||||
const {errors, formData: {username}} = this.state;
|
||||
const {validForm, invalidForm} = this.props;
|
||||
const {validForm, invalidForm, hideCreateUsernameDialog, changeUsername} = this.props;
|
||||
this.displayErrors();
|
||||
|
||||
if (this.isCompleted() && !Object.keys(errors).length) {
|
||||
this.props.changeUsername(this.props.auth.user.id, username);
|
||||
changeUsername(this.props.auth.user.id, username);
|
||||
validForm();
|
||||
hideCreateUsernameDialog();
|
||||
} else {
|
||||
invalidForm(t('createdisplay.check_the_form'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user