PLT-3881 Fix websocket errors after leaving the team (#3815)

This commit is contained in:
Corey Hulen
2016-08-17 11:17:44 -04:00
committed by Joram Wilander
parent dba2deabb0
commit eafc802831
3 changed files with 8 additions and 0 deletions
+2
View File
@@ -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)
}
}
+2
View File
@@ -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) {
+4
View File
@@ -63,6 +63,10 @@ class TeamStoreClass extends EventEmitter {
return this.currentTeamId;
}
setCurrentId(id) {
this.currentTeamId = id;
}
getCurrent() {
const team = this.teams[this.currentTeamId];