From b24c50d2132d8e5f31a7cf7b432f656116e11ecc Mon Sep 17 00:00:00 2001 From: D3SOX Date: Thu, 6 Jun 2024 09:02:40 +0200 Subject: [PATCH] fix(mediaPlaybackSpeed): add error boundary --- src/plugins/mediaPlaybackSpeed/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/mediaPlaybackSpeed/index.tsx b/src/plugins/mediaPlaybackSpeed/index.tsx index 5b2328cf3..710d0ac99 100644 --- a/src/plugins/mediaPlaybackSpeed/index.tsx +++ b/src/plugins/mediaPlaybackSpeed/index.tsx @@ -7,6 +7,7 @@ import "./styles.css"; import { classNameFactory } from "@api/Styles"; +import ErrorBoundary from "@components/ErrorBoundary"; import { makeRange } from "@components/PluginSettings/components"; import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; @@ -24,7 +25,7 @@ export default definePlugin({ description: "Adds an icon to change the playback speed of media embeds", authors: [Devs.D3SOX], - playbackSpeedComponent(mediaRef: RefObject) { + playbackSpeedComponent: ErrorBoundary.wrap((mediaRef: RefObject) => { const changeSpeed = (speed: number) => { const media = mediaRef.current; if (media) { @@ -36,7 +37,7 @@ export default definePlugin({ {tooltipProps => (