aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2023-02-16 22:46:51 +0100
committerVendicated <vendicated@riseup.net>2023-02-16 22:46:51 +0100
commit6807820f6c47fbd4afb8d2b1d83469b60490dd65 (patch)
tree1739faf3c47649238ee2916a95ff42c56291da15 /src
parent3cad0d60b4524b3c58141835e458b129fa75bb12 (diff)
downloadVencord-6807820f6c47fbd4afb8d2b1d83469b60490dd65.tar.gz
Vencord-6807820f6c47fbd4afb8d2b1d83469b60490dd65.tar.bz2
Vencord-6807820f6c47fbd4afb8d2b1d83469b60490dd65.zip
Badges should use ErrorBoundaries
Diffstat (limited to 'src')
-rw-r--r--src/api/Badges.ts2
1 files changed, 2 insertions, 0 deletions
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 <https://www.gnu.org/licenses/>.
*/
+import ErrorBoundary from "@components/ErrorBoundary";
import { User } from "discord-types/general";
import { ComponentType, HTMLProps } from "react";
@@ -52,6 +53,7 @@ const Badges = new Set<ProfileBadge>();
* @param badge The badge to register
*/
export function addBadge(badge: ProfileBadge) {
+ badge.component &&= ErrorBoundary.wrap(badge.component, { noop: true });
Badges.add(badge);
}