Added error boundary

This commit is contained in:
Ryfter 2025-01-25 11:54:52 -05:00
parent 7f7cf02d45
commit 1cd541fd67

View file

@ -4,6 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later * SPDX-License-Identifier: GPL-3.0-or-later
*/ */
import ErrorBoundary from "@components/ErrorBoundary";
import { InfoIcon } from "@components/Icons"; import { InfoIcon } from "@components/Icons";
import { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal"; import { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
import { findByCodeLazy, findExportedComponentLazy } from "@webpack"; import { findByCodeLazy, findExportedComponentLazy } from "@webpack";
@ -144,6 +145,7 @@ function InRoleModal({ guildId, props, roleId }: { guildId: string; props: Modal
const [selectedRole, selectRole] = useState(roles.find(x => x.id === roleId) || roles[0]); const [selectedRole, selectRole] = useState(roles.find(x => x.id === roleId) || roles[0]);
return ( return (
<ErrorBoundary>
<ModalRoot {...props} size={ModalSize.LARGE}> <ModalRoot {...props} size={ModalSize.LARGE}>
<ModalHeader> <ModalHeader>
<Text className={cl("modal-title")} variant="heading-lg/semibold">View members with role</Text> <Text className={cl("modal-title")} variant="heading-lg/semibold">View members with role</Text>
@ -198,6 +200,7 @@ function InRoleModal({ guildId, props, roleId }: { guildId: string; props: Modal
</div> </div>
</ModalContent> </ModalContent>
</ModalRoot > </ModalRoot >
</ErrorBoundary>
); );
} }