PLT-3881 Fix websocket errors after leaving the team (#3815)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
dba2deabb0
Коммит
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 {
|
if result := <-Srv.Store.Channel().RemoveMember(channel.Id, user.Id); result.Err != nil {
|
||||||
return result.Err
|
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 the are on the team begin removed redirect them to the root
|
||||||
if (TeamStore.getCurrentId() === msg.team_id) {
|
if (TeamStore.getCurrentId() === msg.team_id) {
|
||||||
|
TeamStore.setCurrentId('');
|
||||||
|
Client.setTeamId('');
|
||||||
browserHistory.push('/');
|
browserHistory.push('/');
|
||||||
}
|
}
|
||||||
} else if (TeamStore.getCurrentId() === msg.team_id) {
|
} else if (TeamStore.getCurrentId() === msg.team_id) {
|
||||||
|
|||||||
@@ -63,6 +63,10 @@ class TeamStoreClass extends EventEmitter {
|
|||||||
return this.currentTeamId;
|
return this.currentTeamId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setCurrentId(id) {
|
||||||
|
this.currentTeamId = id;
|
||||||
|
}
|
||||||
|
|
||||||
getCurrent() {
|
getCurrent() {
|
||||||
const team = this.teams[this.currentTeamId];
|
const team = this.teams[this.currentTeamId];
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user