1
0
mirror of https://github.com/spacebarchat/client.git synced 2024-11-22 02:12:38 +01:00

filter channel list by view permission

This commit is contained in:
Puyodead1 2023-12-18 12:00:23 -05:00
parent b6a9f12d2b
commit 9a9819cc51
No known key found for this signature in database
GPG Key ID: BA5F91AAEF68E5CE

View File

@ -146,7 +146,9 @@ export default class Guild {
@computed
get channels() {
const guildChannels = this.app.channels.all.filter((channel) => this.channels_.has(channel.id));
const guildChannels = this.app.channels.all.filter(
(channel) => this.channels_.has(channel.id) && channel.hasPermission("VIEW_CHANNEL"),
);
const topLevelChannels = guildChannels.filter((channel) => !channel.parentId);
const sortedChannels = topLevelChannels
.sort(compareChannels)