diff --git a/src/plugins/translate/TranslateIcon.tsx b/src/plugins/translate/TranslateIcon.tsx index d944ec16..af97a53b 100644 --- a/src/plugins/translate/TranslateIcon.tsx +++ b/src/plugins/translate/TranslateIcon.tsx @@ -37,9 +37,12 @@ export function TranslateIcon({ height = 24, width = 24, className }: { height?: ); } -export function TranslateChatBarIcon() { +export function TranslateChatBarIcon({ slateProps }: { slateProps: { type: { analyticsName: string; }; }; }) { const { autoTranslate } = settings.use(["autoTranslate"]); + if (slateProps.type.analyticsName !== "normal") + return null; + return ( {({ onMouseEnter, onMouseLeave }) => ( diff --git a/src/plugins/translate/index.tsx b/src/plugins/translate/index.tsx index cb612547..d71b2da4 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) => ( + + + + ) });