diff options
author | V <vendicated@riseup.net> | 2023-05-11 02:34:25 +0200 |
---|---|---|
committer | V <vendicated@riseup.net> | 2023-05-11 02:35:06 +0200 |
commit | 6e3cafce42ea4eee7e1103225ebe5cb9931967e1 (patch) | |
tree | 6fc847562b2d246749fffdf90dc94dc9dd561ade /src/plugins/translate/index.tsx | |
parent | 4d0a0644254294371831be0fe342aa824cc717ff (diff) | |
download | Vencord-6e3cafce42ea4eee7e1103225ebe5cb9931967e1.tar.gz Vencord-6e3cafce42ea4eee7e1103225ebe5cb9931967e1.tar.bz2 Vencord-6e3cafce42ea4eee7e1103225ebe5cb9931967e1.zip |
Translate: Only add button in chat box
Diffstat (limited to 'src/plugins/translate/index.tsx')
-rw-r--r-- | src/plugins/translate/index.tsx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/translate/index.tsx b/src/plugins/translate/index.tsx index cb61254..d71b2da 100644 --- a/src/plugins/translate/index.tsx +++ b/src/plugins/translate/index.tsx @@ -45,7 +45,7 @@ export default definePlugin({ find: ".activeCommandOption", replacement: { match: /(.)\.push.{1,30}disabled:(\i),.{1,20}\},"gift"\)\)/, - replace: "$&;try{$2||$1.push($self.chatBarIcon())}catch{}", + replace: "$&;try{$2||$1.push($self.chatBarIcon(arguments[0]))}catch{}", } }, ], @@ -82,5 +82,9 @@ export default definePlugin({ removeAccessory("vc-translation"); }, - chatBarIcon: ErrorBoundary.wrap(TranslateChatBarIcon, { noop: true }), + chatBarIcon: (slateProps: any) => ( + <ErrorBoundary noop> + <TranslateChatBarIcon slateProps={slateProps} /> + </ErrorBoundary> + ) }); |