summaryrefslogtreecommitdiffstats
path: root/webapp/components/login/login_controller.jsx
diff options
context:
space:
mode:
authorCarlos Tadeu Panato Junior <ctadeu@gmail.com>2017-01-20 03:02:05 +0100
committerenahum <nahumhbl@gmail.com>2017-01-19 23:02:05 -0300
commit48e1fa8aa0ae3234d826d16eaff39cb373bc7d3d (patch)
treec37ce0309861442288ae36f33064a66e576e58fd /webapp/components/login/login_controller.jsx
parentd3a285e64d051aa8d5c4c9854597dfbcce107675 (diff)
downloadchat-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/login/login_controller.jsx')
-rw-r--r--webapp/components/login/login_controller.jsx15
1 files changed, 9 insertions, 6 deletions
diff --git a/webapp/components/login/login_controller.jsx b/webapp/components/login/login_controller.jsx
index b02d66bbb..3064371c3 100644
--- a/webapp/components/login/login_controller.jsx
+++ b/webapp/components/login/login_controller.jsx
@@ -6,6 +6,7 @@ import ErrorBar from 'components/error_bar.jsx';
import FormError from 'components/form_error.jsx';
import * as GlobalActions from 'actions/global_actions.jsx';
+import {addUserToTeamFromInvite} from 'actions/team_actions.jsx';
import BrowserStore from 'stores/browser_store.jsx';
import UserStore from 'stores/user_store.jsx';
@@ -146,12 +147,14 @@ export default class LoginController extends React.Component {
token,
() => {
// check for query params brought over from signup_user_complete
- const query = this.props.location.query;
- if (query.id || query.h) {
- Client.addUserToTeamFromInvite(
- query.d,
- query.h,
- 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,
(team) => {
this.finishSignin(team);
},