mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-11 02:16:23 +00:00
fix(mediaPlaybackSpeed): add error boundary
This commit is contained in:
parent
d2efeff84f
commit
b24c50d213
1 changed files with 4 additions and 3 deletions
|
@ -7,6 +7,7 @@
|
||||||
import "./styles.css";
|
import "./styles.css";
|
||||||
|
|
||||||
import { classNameFactory } from "@api/Styles";
|
import { classNameFactory } from "@api/Styles";
|
||||||
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { makeRange } from "@components/PluginSettings/components";
|
import { makeRange } from "@components/PluginSettings/components";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
|
@ -24,7 +25,7 @@ export default definePlugin({
|
||||||
description: "Adds an icon to change the playback speed of media embeds",
|
description: "Adds an icon to change the playback speed of media embeds",
|
||||||
authors: [Devs.D3SOX],
|
authors: [Devs.D3SOX],
|
||||||
|
|
||||||
playbackSpeedComponent(mediaRef: RefObject<HTMLMediaElement>) {
|
playbackSpeedComponent: ErrorBoundary.wrap((mediaRef: RefObject<HTMLMediaElement>) => {
|
||||||
const changeSpeed = (speed: number) => {
|
const changeSpeed = (speed: number) => {
|
||||||
const media = mediaRef.current;
|
const media = mediaRef.current;
|
||||||
if (media) {
|
if (media) {
|
||||||
|
@ -65,7 +66,7 @@ export default definePlugin({
|
||||||
)}
|
)}
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
},
|
}),
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
// voice message embeds
|
// voice message embeds
|
||||||
|
|
Loading…
Reference in a new issue