diff options
author | Carlos Tadeu Panato Junior <ctadeu@gmail.com> | 2017-01-20 03:02:05 +0100 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2017-01-19 23:02:05 -0300 |
commit | 48e1fa8aa0ae3234d826d16eaff39cb373bc7d3d (patch) | |
tree | c37ce0309861442288ae36f33064a66e576e58fd /webapp/components/signup | |
parent | d3a285e64d051aa8d5c4c9854597dfbcce107675 (diff) | |
download | chat-48e1fa8aa0ae3234d826d16eaff39cb373bc7d3d.tar.gz chat-48e1fa8aa0ae3234d826d16eaff39cb373bc7d3d.tar.bz2 chat-48e1fa8aa0ae3234d826d16eaff39cb373bc7d3d.zip |
Move instances of Client.addUserToTeamFromInvite() in components to an action (#5132)
Diffstat (limited to 'webapp/components/signup')
-rw-r--r-- | webapp/components/signup/components/signup_ldap.jsx | 15 | ||||
-rw-r--r-- | webapp/components/signup/signup_controller.jsx | 3 |
2 files changed, 12 insertions, 6 deletions
diff --git a/webapp/components/signup/components/signup_ldap.jsx b/webapp/components/signup/components/signup_ldap.jsx index d80b27159..3e8b39a26 100644 --- a/webapp/components/signup/components/signup_ldap.jsx +++ b/webapp/components/signup/components/signup_ldap.jsx @@ -5,6 +5,7 @@ import FormError from 'components/form_error.jsx'; import * as GlobalActions from 'actions/global_actions.jsx'; import {track} from 'actions/analytics_actions.jsx'; +import {addUserToTeamFromInvite} from 'actions/team_actions.jsx'; import * as Utils from 'utils/utils.jsx'; import Client from 'client/web_client.jsx'; @@ -69,11 +70,15 @@ export default class SignupLdap extends React.Component { } handleLdapSignupSuccess() { - if (this.props.location.query.id || this.props.location.query.h) { - Client.addUserToTeamFromInvite( - this.props.location.query.d, - this.props.location.query.h, - this.props.location.query.id, + const hash = this.props.location.query.h; + const data = this.props.location.query.d; + const inviteId = this.props.location.query.id; + + if (inviteId || hash) { + addUserToTeamFromInvite( + data, + hash, + inviteId, () => { this.finishSignup(); }, diff --git a/webapp/components/signup/signup_controller.jsx b/webapp/components/signup/signup_controller.jsx index ee53f6b67..a4cc8f86d 100644 --- a/webapp/components/signup/signup_controller.jsx +++ b/webapp/components/signup/signup_controller.jsx @@ -12,6 +12,7 @@ import BrowserStore from 'stores/browser_store.jsx'; import * as AsyncClient from 'utils/async_client.jsx'; import Client from 'client/web_client.jsx'; import * as GlobalActions from 'actions/global_actions.jsx'; +import {addUserToTeamFromInvite} from 'actions/team_actions.jsx'; import logoImage from 'images/logo.png'; import ErrorBar from 'components/error_bar.jsx'; @@ -68,7 +69,7 @@ export default class SignupController extends React.Component { const userLoggedIn = UserStore.getCurrentUser() != null; if ((inviteId || hash) && userLoggedIn) { - Client.addUserToTeamFromInvite( + addUserToTeamFromInvite( data, hash, inviteId, |