feat(Translate): add toggle for chat bar icon (#2418)

main
Cats 6 months ago committed by GitHub
parent d6507947f5
commit a99354503f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -40,9 +40,9 @@ export function TranslateIcon({ height = 24, width = 24, className }: { height?:
}
export const TranslateChatBarIcon: ChatBarButton = ({ isMainChat }) => {
const { autoTranslate } = settings.use(["autoTranslate"]);
const { autoTranslate, showChatBarButton } = settings.use(["autoTranslate", "showChatBarButton"]);
if (!isMainChat) return null;
if (!isMainChat || !showChatBarButton) return null;
const toggle = () => {
const newState = !autoTranslate;

@ -48,6 +48,11 @@ export const settings = definePluginSettings({
type: OptionType.BOOLEAN,
description: "Automatically translate your messages before sending. You can also shift/right click the translate button to toggle this",
default: false
},
showChatBarButton: {
type: OptionType.BOOLEAN,
description: "Show translate button in chat bar",
default: true
}
}).withPrivateSettings<{
showAutoTranslateAlert: boolean;

Loading…
Cancel
Save