From ec091a79591cf9619dd589102f5b338827b70ad8 Mon Sep 17 00:00:00 2001
From: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
Date: Fri, 19 May 2023 21:24:56 -0300
Subject: Fix SHC broken patches; Sort PermViewer channel overwrites roles
 (#1166)

---
 src/plugins/permissionsViewer/index.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/plugins/permissionsViewer/index.tsx')

diff --git a/src/plugins/permissionsViewer/index.tsx b/src/plugins/permissionsViewer/index.tsx
index 208fef3..480efc1 100644
--- a/src/plugins/permissionsViewer/index.tsx
+++ b/src/plugins/permissionsViewer/index.tsx
@@ -27,7 +27,7 @@ import type { Guild, GuildMember } from "discord-types/general";
 
 import openRolesAndUsersPermissionsModal, { PermissionType, RoleOrUserPermission } from "./components/RolesAndUsersPermissions";
 import UserPermissions from "./components/UserPermissions";
-import { getSortedRoles } from "./utils";
+import { getSortedRoles, sortPermissionOverwrites } from "./utils";
 
 export const enum PermissionsSortOrder {
     HighestRole,
@@ -94,12 +94,12 @@ function MenuItem(guildId: string, id?: string, type?: MenuItemParentType) {
                     case MenuItemParentType.Channel: {
                         const channel = ChannelStore.getChannel(id!);
 
-                        permissions = Object.values(channel.permissionOverwrites).map(({ id, allow, deny, type }) => ({
+                        permissions = sortPermissionOverwrites(Object.values(channel.permissionOverwrites).map(({ id, allow, deny, type }) => ({
                             type: type as PermissionType,
                             id,
                             overwriteAllow: allow,
                             overwriteDeny: deny
-                        }));
+                        })), guildId);
 
                         header = channel.name;
 
-- 
cgit 

