mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fix for SignupEmail invite handling (#6820)
* Fix SignupEmail invite handling * Fix eslint errors
This commit is contained in:
committed by
Joram Wilander
parent
39b071bc0e
commit
e6ca2974cd
@@ -52,9 +52,9 @@ export default class SignupEmail extends React.Component {
|
||||
let teamDisplayName = '';
|
||||
let teamName = '';
|
||||
let teamId = '';
|
||||
let loading = true;
|
||||
let serverError = '';
|
||||
let noOpenServerError = false;
|
||||
let loading = false;
|
||||
const serverError = '';
|
||||
const noOpenServerError = false;
|
||||
|
||||
if (hash && hash.length > 0) {
|
||||
const parsedData = JSON.parse(data);
|
||||
@@ -62,37 +62,40 @@ export default class SignupEmail extends React.Component {
|
||||
teamDisplayName = parsedData.display_name;
|
||||
teamName = parsedData.name;
|
||||
teamId = parsedData.id;
|
||||
loading = false;
|
||||
} else if (inviteId && inviteId.length > 0) {
|
||||
loading = true;
|
||||
getInviteInfo(
|
||||
inviteId,
|
||||
(inviteData) => {
|
||||
if (!inviteData) {
|
||||
this.setState({loading: false});
|
||||
return;
|
||||
}
|
||||
|
||||
serverError = '';
|
||||
teamDisplayName = inviteData.display_name;
|
||||
teamName = inviteData.name;
|
||||
teamId = inviteData.id;
|
||||
this.setState({
|
||||
loading: false,
|
||||
serverError: '',
|
||||
teamDisplayName: inviteData.display_name,
|
||||
teamName: inviteData.name,
|
||||
teamId: inviteData.id
|
||||
});
|
||||
},
|
||||
() => {
|
||||
noOpenServerError = true;
|
||||
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({
|
||||
loading: false,
|
||||
noOpenServerError: true,
|
||||
serverError: (
|
||||
<FormattedMessage
|
||||
id='signup_user_completed.invalid_invite'
|
||||
defaultMessage='The invite link was invalid. Please speak with your Administrator to receive an invitation.'
|
||||
/>
|
||||
)
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
loading = false;
|
||||
data = null;
|
||||
hash = null;
|
||||
} else {
|
||||
loading = false;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user