diff --git a/src/plugins/webContextMenus.web/index.ts b/src/plugins/webContextMenus.web/index.ts index cf4f1ff8..aee65252 100644 --- a/src/plugins/webContextMenus.web/index.ts +++ b/src/plugins/webContextMenus.web/index.ts @@ -36,17 +36,16 @@ async function fetchImage(url: string) { return await res.blob(); } -let result; -switch (true) { - case IS_VESKTOP || IS_EQUIBOP: - case "legcord" in window: - case "goofcord" in window: - result = true; - break; - default: - result = false; -} +let requiredByPlatform = false; +let hideSetting = false; +if (IS_VESKTOP || IS_EQUIBOP) { + requiredByPlatform = true; + hideSetting = true; +} else if ("legcord" in window || "goofcord" in window) { + requiredByPlatform = true; + hideSetting = false; +} const settings = definePluginSettings({ // This needs to be all in one setting because to enable any of these, we need to make Discord use their desktop context @@ -54,15 +53,15 @@ const settings = definePluginSettings({ addBack: { type: OptionType.BOOLEAN, description: "Add back the Discord context menus for images, links and the chat input bar", - default: false, + default: true, restartNeeded: true, // Web slate menu has proper spellcheck suggestions and image context menu is also pretty good, // so disable this by default. Vesktop just doesn't, so we force enable it there - hidden: result, + hidden: hideSetting, } }); -const shouldAddBackMenus = () => result || settings.store.addBack; +const shouldAddBackMenus = () => hideSetting || settings.store.addBack; const MEDIA_PROXY_URL = "https://media.discordapp.net"; const CDN_URL = "cdn.discordapp.com"; @@ -91,7 +90,7 @@ export default definePlugin({ description: "Re-adds context menus missing in the web version of Discord: Links & Images (Copy/Open Link/Image), Text Area (Copy, Cut, Paste, SpellCheck)", authors: [Devs.Ven], enabledByDefault: true, - required: result, + required: requiredByPlatform, settings,