Fix error when updating a GM/DM (#25186)

This commit is contained in:
Daniel Espino García
2023-11-06 13:19:58 +01:00
committed by GitHub
parent 2f86b1ffd7
commit 83e06a65a6

View File

@@ -644,7 +644,8 @@ export function handleChannelUpdatedEvent(msg) {
if (channel.id === getCurrentChannelId(state)) {
// using channel's team_id to ensure we always redirect to current channel even if channel's team changes.
getHistory().replace(`${getRelativeTeamUrl(state, channel.team_id)}/channels/${channel.name}`);
const teamId = channel.team_id || getCurrentTeamId(state);
getHistory().replace(`${getRelativeTeamUrl(state, teamId)}/channels/${channel.name}`);
}
};
}