diff --git a/client/coral-embed-stream/src/actions/auth.js b/client/coral-embed-stream/src/actions/auth.js index 72a6ef3bd..37ff622db 100644 --- a/client/coral-embed-stream/src/actions/auth.js +++ b/client/coral-embed-stream/src/actions/auth.js @@ -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()); } }) diff --git a/plugins/talk-plugin-auth/client/components/ChangeUsername.js b/plugins/talk-plugin-auth/client/components/ChangeUsername.js index cdba62cad..12927188f 100644 --- a/plugins/talk-plugin-auth/client/components/ChangeUsername.js +++ b/plugins/talk-plugin-auth/client/components/ChangeUsername.js @@ -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')); }