From 1cd541fd67771a764913d2c5d591502260c1d4d1 Mon Sep 17 00:00:00 2001 From: Ryfter Date: Sat, 25 Jan 2025 11:54:52 -0500 Subject: [PATCH] Added error boundary --- RoleMembersModal.tsx | 97 +++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 47 deletions(-) diff --git a/RoleMembersModal.tsx b/RoleMembersModal.tsx index de0a4af..e14f04e 100644 --- a/RoleMembersModal.tsx +++ b/RoleMembersModal.tsx @@ -4,6 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import ErrorBoundary from "@components/ErrorBoundary"; import { InfoIcon } from "@components/Icons"; import { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal"; import { findByCodeLazy, findExportedComponentLazy } from "@webpack"; @@ -144,60 +145,62 @@ function InRoleModal({ guildId, props, roleId }: { guildId: string; props: Modal const [selectedRole, selectRole] = useState(roles.find(x => x.id === roleId) || roles[0]); return ( - - - View members with role - - - -
- - {roles.map((role, index) => { + + + + View members with role + + + +
+ + {roles.map((role, index) => { - if (role.id === guildId) return; + if (role.id === guildId) return; - const roleIconSrc = role != null ? getRoleIconSrc(role) : undefined; + const roleIconSrc = role != null ? getRoleIconSrc(role) : undefined; - return ( -
selectRole(roles[index])} - role="button" - tabIndex={0} - key={role.id} - > + return (
selectRole(roles[index])} + role="button" + tabIndex={0} + key={role.id} > - - { - roleIconSrc != null && ( - - ) +
+ + { + roleIconSrc != null && ( + + ) - } - - {role?.name || "Unknown role"} - + } + + {role?.name || "Unknown role"} + +
-
- ); - })} -
-
- -
- - + ); + })} + +
+ +
+ + + ); }