From a39f375d344e36e7220d0053c49bf50cf459a749 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Mon, 31 Oct 2022 21:10:36 +0100 Subject: [PATCH] Update Translator.plugin.js --- Plugins/Translator/Translator.plugin.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Plugins/Translator/Translator.plugin.js b/Plugins/Translator/Translator.plugin.js index 11398e39a4..1d684a3b97 100644 --- a/Plugins/Translator/Translator.plugin.js +++ b/Plugins/Translator/Translator.plugin.js @@ -2,7 +2,7 @@ * @name Translator * @author DevilBro * @authorId 278543574059057154 - * @version 2.4.2 + * @version 2.4.3 * @description Allows you to translate Messages and your outgoing Messages within Discord * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -653,7 +653,7 @@ module.exports = (_ => { } processChannelTextAreaContainer (e) { - if (e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL && e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY) return; + if (e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL && e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY && e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.SIDEBAR) return; BDFDB.PatchUtils.patch(this, e.instance.props, "onSubmit", {instead: e2 => { if (this.isTranslationEnabled(e.instance.props.channel.id) && e2.methodArguments[0].value) { e2.stopOriginalMethodCall(); @@ -675,12 +675,11 @@ module.exports = (_ => { } processChannelTextAreaButtons (e) { - if (this.settings.general.addTranslateButton && (e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) && !e.instance.props.disabled) { - e.returnvalue.props.children.unshift(BDFDB.ReactUtils.createElement(TranslateButtonComponent, { - guildId: e.instance.props.channel.guild_id ? e.instance.props.channel.guild_id : "@me", - channelId: e.instance.props.channel.id - })); - } + if (!this.settings.general.addTranslateButton || e.instance.props.disabled || e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL && e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY && e.instance.props.type != BDFDB.DiscordConstants.ChannelTextAreaTypes.SIDEBAR) return; + e.returnvalue.props.children.unshift(BDFDB.ReactUtils.createElement(TranslateButtonComponent, { + guildId: e.instance.props.channel.guild_id ? e.instance.props.channel.guild_id : "@me", + channelId: e.instance.props.channel.id + })); } processMessages (e) {