From 6e3cafce42ea4eee7e1103225ebe5cb9931967e1 Mon Sep 17 00:00:00 2001 From: V Date: Thu, 11 May 2023 02:34:25 +0200 Subject: Translate: Only add button in chat box --- src/plugins/translate/TranslateIcon.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/plugins/translate/TranslateIcon.tsx') diff --git a/src/plugins/translate/TranslateIcon.tsx b/src/plugins/translate/TranslateIcon.tsx index d944ec1..af97a53 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 }) => ( -- cgit