summaryrefslogtreecommitdiffstats
path: root/webapp/actions/team_actions.jsx
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2017-05-12 08:00:28 -0400
committerJoramWilander <jwawilander@gmail.com>2017-05-12 08:00:28 -0400
commit9d109b070037951fcd0832b785eba8a3db9a157c (patch)
tree5d109da2e9e088f16eff0ad1421876a3d3da412e /webapp/actions/team_actions.jsx
parentb1c39204a63a87d2cbc57f66cf9db50c938b2ee5 (diff)
parenta21a06afd9907e9911dcb166d902cba9f405c7cb (diff)
downloadchat-9d109b070037951fcd0832b785eba8a3db9a157c.tar.gz
chat-9d109b070037951fcd0832b785eba8a3db9a157c.tar.bz2
chat-9d109b070037951fcd0832b785eba8a3db9a157c.zip
Merge branch 'release-3.9' into merge-3.9
Diffstat (limited to 'webapp/actions/team_actions.jsx')
-rw-r--r--webapp/actions/team_actions.jsx23
1 files changed, 23 insertions, 0 deletions
diff --git a/webapp/actions/team_actions.jsx b/webapp/actions/team_actions.jsx
index 44b554ded..6407e1b12 100644
--- a/webapp/actions/team_actions.jsx
+++ b/webapp/actions/team_actions.jsx
@@ -28,6 +28,9 @@ import {
getTeamMembersForUser as getTeamMembersForUserRedux
} from 'mattermost-redux/actions/teams';
+import {TeamTypes} from 'mattermost-redux/action_types';
+import {batchActions} from 'redux-batched-actions';
+
export function checkIfTeamExists(teamName, onSuccess, onError) {
checkIfTeamExistsRedux(teamName)(dispatch, getState).then(
(exists) => {
@@ -104,6 +107,26 @@ export function addUserToTeamFromInvite(data, hash, inviteId, success, error) {
hash,
inviteId,
(team) => {
+ const member = {
+ team_id: team.id,
+ user_id: getState().entities.users.currentUserId,
+ roles: 'team_user',
+ delete_at: 0,
+ msg_count: 0,
+ mention_count: 0
+ };
+
+ dispatch(batchActions([
+ {
+ type: TeamTypes.RECEIVED_TEAMS_LIST,
+ data: [team]
+ },
+ {
+ type: TeamTypes.RECEIVED_MY_TEAM_MEMBER,
+ data: member
+ }
+ ]));
+
if (success) {
success(team);
}