From 8291cdfc12d37b4902cc1bd2b32af975ba6d49f3 Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Sun, 4 Apr 2021 02:37:19 +0300 Subject: [PATCH] disable dev tools on electron-prompt --- index.js | 4 +++- menu.js | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 478d2f86..baa8c49c 100644 --- a/index.js +++ b/index.js @@ -37,7 +37,9 @@ if (config.get("options.proxy")) { } // Adds debug features like hotkeys for triggering dev tools and reload -require("electron-debug")(); +require("electron-debug")({ + showDevTools: false //disable dev tools on electron-prompt +}); // Prevent window being garbage collected let mainWindow; diff --git a/menu.js b/menu.js index b51fb516..9deef729 100644 --- a/menu.js +++ b/menu.js @@ -148,7 +148,7 @@ const mainMenuTemplate = (win) => [ type: "checkbox", checked: !!config.get("options.proxy"), click: (item) => { - setProxy(item, win); + setProxy(item); } }, { @@ -310,7 +310,7 @@ module.exports.setApplicationMenu = (win) => { }; const iconPath = path.join(__dirname, "assets", "youtube-music-tray.png"); -function setProxy(item, win) { +function setProxy(item) { prompt({ title: 'Set Proxy', label: 'Enter Proxy Adress:', @@ -325,8 +325,6 @@ function setProxy(item, win) { .then((input) => { if(input !== null) { config.set("options.proxy", input); - if(input === "") - item.checked = false; item.checked = (input === "") ? false : true; } else { //user pressed cancel item.checked = !item.checked; //reset checkbox