From 6807820f6c47fbd4afb8d2b1d83469b60490dd65 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 16 Feb 2023 22:46:51 +0100 Subject: [PATCH] Badges should use ErrorBoundaries --- src/api/Badges.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api/Badges.ts b/src/api/Badges.ts index 3607f37..d4aabaf 100644 --- a/src/api/Badges.ts +++ b/src/api/Badges.ts @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +import ErrorBoundary from "@components/ErrorBoundary"; import { User } from "discord-types/general"; import { ComponentType, HTMLProps } from "react"; @@ -52,6 +53,7 @@ const Badges = new Set(); * @param badge The badge to register */ export function addBadge(badge: ProfileBadge) { + badge.component &&= ErrorBoundary.wrap(badge.component, { noop: true }); Badges.add(badge); }