summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-06-16 12:34:53 -0400
committerCorey Hulen <corey@hulen.com>2017-06-16 09:34:53 -0700
commit1897a7ea9e1715e3aff9edb64f7c3f541f381881 (patch)
treedf3af612d4f05630e17f367c50e1d86031e2a3f7 /webapp
parent9d082cfe77bb4da450e73d23467353e7b88c37b0 (diff)
downloadchat-1897a7ea9e1715e3aff9edb64f7c3f541f381881.tar.gz
chat-1897a7ea9e1715e3aff9edb64f7c3f541f381881.tar.bz2
chat-1897a7ea9e1715e3aff9edb64f7c3f541f381881.zip
PLT-6751 Fixed error message when trying to join full team (#6657)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/signup/signup_controller.jsx46
1 files changed, 22 insertions, 24 deletions
diff --git a/webapp/components/signup/signup_controller.jsx b/webapp/components/signup/signup_controller.jsx
index af35c5d8d..d702b8cdf 100644
--- a/webapp/components/signup/signup_controller.jsx
+++ b/webapp/components/signup/signup_controller.jsx
@@ -83,18 +83,7 @@ export default class SignupController extends React.Component {
}
);
},
- () => {
- this.setState({ // eslint-disable-line react/no-did-mount-set-state
- noOpenServerError: true,
- loading: false,
- serverError: (
- <FormattedMessage
- id='signup_user_completed.invalid_invite'
- defaultMessage='The invite link was invalid. Please speak with your Administrator to receive an invitation.'
- />
- )
- });
- }
+ this.handleInvalidInvite
);
return;
@@ -113,18 +102,7 @@ export default class SignupController extends React.Component {
loading: false
});
},
- () => {
- this.setState({ // eslint-disable-line react/no-did-mount-set-state
- noOpenServerError: true,
- loading: false,
- serverError: (
- <FormattedMessage
- id='signup_user_completed.invalid_invite'
- defaultMessage='The invite link was invalid. Please speak with your Administrator to receive an invitation.'
- />
- )
- });
- }
+ this.handleInvalidInvite
);
return;
@@ -136,6 +114,26 @@ export default class SignupController extends React.Component {
}
}
+ handleInvalidInvite = (err) => {
+ let serverError;
+ if (err.id === 'store.sql_user.save.max_accounts.app_error') {
+ serverError = err.message;
+ } else {
+ serverError = (
+ <FormattedMessage
+ id='signup_user_completed.invalid_invite'
+ defaultMessage='The invite link was invalid. Please speak with your Administrator to receive an invitation.'
+ />
+ );
+ }
+
+ this.setState({
+ noOpenServerError: true,
+ loading: false,
+ serverError
+ });
+ }
+
renderSignupControls() {
let signupControls = [];