disable dev tools on electron-prompt

This commit is contained in:
Araxeus
2021-04-04 02:37:19 +03:00
parent 2e6fffc903
commit 8291cdfc12
2 changed files with 5 additions and 5 deletions

View File

@ -37,7 +37,9 @@ if (config.get("options.proxy")) {
} }
// Adds debug features like hotkeys for triggering dev tools and reload // 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 // Prevent window being garbage collected
let mainWindow; let mainWindow;

View File

@ -148,7 +148,7 @@ const mainMenuTemplate = (win) => [
type: "checkbox", type: "checkbox",
checked: !!config.get("options.proxy"), checked: !!config.get("options.proxy"),
click: (item) => { 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"); const iconPath = path.join(__dirname, "assets", "youtube-music-tray.png");
function setProxy(item, win) { function setProxy(item) {
prompt({ prompt({
title: 'Set Proxy', title: 'Set Proxy',
label: 'Enter Proxy Adress:', label: 'Enter Proxy Adress:',
@ -325,8 +325,6 @@ function setProxy(item, win) {
.then((input) => { .then((input) => {
if(input !== null) { if(input !== null) {
config.set("options.proxy", input); config.set("options.proxy", input);
if(input === "")
item.checked = false;
item.checked = (input === "") ? false : true; item.checked = (input === "") ? false : true;
} else { //user pressed cancel } else { //user pressed cancel
item.checked = !item.checked; //reset checkbox item.checked = !item.checked; //reset checkbox