mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
PLT-3881 Fix websocket errors after leaving the team (#3815)
This commit is contained in:
committed by
Joram Wilander
parent
dba2deabb0
commit
eafc802831
@@ -331,6 +331,8 @@ func LeaveTeam(team *model.Team, user *model.User) *model.AppError {
|
||||
if result := <-Srv.Store.Channel().RemoveMember(channel.Id, user.Id); result.Err != nil {
|
||||
return result.Err
|
||||
}
|
||||
|
||||
InvalidateCacheForChannel(channel.Id)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -194,6 +194,8 @@ function handleLeaveTeamEvent(msg) {
|
||||
|
||||
// if the are on the team begin removed redirect them to the root
|
||||
if (TeamStore.getCurrentId() === msg.team_id) {
|
||||
TeamStore.setCurrentId('');
|
||||
Client.setTeamId('');
|
||||
browserHistory.push('/');
|
||||
}
|
||||
} else if (TeamStore.getCurrentId() === msg.team_id) {
|
||||
|
||||
@@ -63,6 +63,10 @@ class TeamStoreClass extends EventEmitter {
|
||||
return this.currentTeamId;
|
||||
}
|
||||
|
||||
setCurrentId(id) {
|
||||
this.currentTeamId = id;
|
||||
}
|
||||
|
||||
getCurrent() {
|
||||
const team = this.teams[this.currentTeamId];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user