Fix links to channels closing the channel (#6446)

This commit is contained in:
Daniel Espino García
2022-06-30 17:13:28 +02:00
committed by GitHub
parent 330dc0b9ad
commit 82c514013c
6 changed files with 29 additions and 28 deletions

View File

@@ -28,6 +28,11 @@ export function isDMorGM(channel: Channel | ChannelModel): boolean {
return directTypes.includes(channel.type);
}
export function isArchived(channel: Channel | ChannelModel): boolean {
const deleteAt = 'delete_at' in channel ? channel.delete_at : channel.deleteAt;
return deleteAt > 0;
}
export function selectDefaultChannelForTeam<T extends Channel|ChannelModel>(channels: T[], memberships: ChannelMembership[], teamId: string, roles?: Role[], locale = DEFAULT_LOCALE) {
let channel: T|undefined;
let canIJoinPublicChannelsInTeam = false;