summaryrefslogtreecommitdiffstats
path: root/webapp/actions/global_actions.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/actions/global_actions.jsx')
-rw-r--r--webapp/actions/global_actions.jsx13
1 files changed, 13 insertions, 0 deletions
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);