diff options
author | V <vendicated@riseup.net> | 2023-09-09 19:49:11 +0200 |
---|---|---|
committer | V <vendicated@riseup.net> | 2023-09-09 19:49:11 +0200 |
commit | 3a5b70d410d8c3e2c644732e5849ffcf88499d66 (patch) | |
tree | cbd4ba2aa436195fed8c4a2758a2b5d1e67c0086 /src/plugins | |
parent | e08d49edacef63d1dabb9aa1a912935a8699626d (diff) | |
download | Vencord-3a5b70d410d8c3e2c644732e5849ffcf88499d66.tar.gz Vencord-3a5b70d410d8c3e2c644732e5849ffcf88499d66.tar.bz2 Vencord-3a5b70d410d8c3e2c644732e5849ffcf88499d66.zip |
Dearrow: Fix button
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/dearrow/index.tsx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/plugins/dearrow/index.tsx b/src/plugins/dearrow/index.tsx index 7e50bca..f896531 100644 --- a/src/plugins/dearrow/index.tsx +++ b/src/plugins/dearrow/index.tsx @@ -74,8 +74,8 @@ async function embedDidMount(this: Component<Props>) { } } -function renderButton(this: Component<Props>) { - const { embed } = this.props; +function renderButton(component: Component<Props>) { + const { embed } = component.props; if (!embed?.dearrow) return null; return ( @@ -97,7 +97,7 @@ function renderButton(this: Component<Props>) { embed.thumbnail.proxyURL = oldThumb; } - this.forceUpdate(); + component.forceUpdate(); }} > {/* Dearrow Icon, taken from https://dearrow.ajay.app/logo.svg (and optimised) */} @@ -134,7 +134,13 @@ export default definePlugin({ authors: [Devs.Ven], embedDidMount, - renderButton: ErrorBoundary.wrap(renderButton, { noop: true }), + renderButton(component: Component<Props>) { + return ( + <ErrorBoundary noop> + {renderButton(component)} + </ErrorBoundary> + ); + }, patches: [{ find: "this.renderInlineMediaEmbed", @@ -148,7 +154,7 @@ export default definePlugin({ // add dearrow button { match: /children:\[(?=null!=\i\?\i\.renderSuppressButton)/, - replace: "children:[$self.renderButton.call(this)," + replace: "children:[$self.renderButton(this)," } ] }], |