From 25385c8c2a46b236d902959ac20cd9f44789eeb8 Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Thu, 7 Jul 2016 08:44:31 -0800 Subject: PLT-2863 fixing bad merge that broke this PR (#3523) * PLT-2863 adding remove user from team * PLT-2863 adding the client side UI * Fixing trailing space * Fixing reported issues * Adding documentatino * Switching to final javascript driver * Fixing bad merge * Fixing bad merge --- webapp/actions/global_actions.jsx | 13 +++++++++++++ webapp/actions/websocket_actions.jsx | 2 ++ 2 files changed, 15 insertions(+) (limited to 'webapp') diff --git a/webapp/actions/global_actions.jsx b/webapp/actions/global_actions.jsx index aa51f6f62..d9b89f987 100644 --- a/webapp/actions/global_actions.jsx +++ b/webapp/actions/global_actions.jsx @@ -205,6 +205,19 @@ export function emitPostFocusRightHandSideFromSearch(post, isMentionSearch) { ); } +export function emitLeaveTeam() { + Client.removeUserFromTeam( + TeamStore.getCurrentId(), + UserStore.getCurrentId(), + () => { + // DO nothing. The websocket should cause a re-direct + }, + (err) => { + AsyncClient.dispatchError(err, 'removeUserFromTeam'); + } + ); +} + export function emitLoadMorePostsEvent() { const id = ChannelStore.getCurrentId(); loadMorePostsTop(id, false); diff --git a/webapp/actions/websocket_actions.jsx b/webapp/actions/websocket_actions.jsx index 9d9cf62b7..7be9d84f3 100644 --- a/webapp/actions/websocket_actions.jsx +++ b/webapp/actions/websocket_actions.jsx @@ -14,6 +14,7 @@ import Client from 'utils/web_client.jsx'; import * as Utils from 'utils/utils.jsx'; import * as AsyncClient from 'utils/async_client.jsx'; import * as GlobalActions from 'actions/global_actions.jsx'; +import * as UserActions from 'actions/user_actions.jsx'; import {handleNewPost} from 'actions/post_actions.jsx'; import Constants from 'utils/constants.jsx'; @@ -232,6 +233,7 @@ function handleLeaveTeamEvent(msg) { browserHistory.push('/'); } } else if (TeamStore.getCurrentId() === msg.team_id) { + UserActions.getMoreDmList(); GlobalActions.emitProfilesForDmList(); } } -- cgit v1.2.3-1-g7c22