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
require("electron-debug")();
require("electron-debug")({
showDevTools: false //disable dev tools on electron-prompt
});
// Prevent window being garbage collected
let mainWindow;

View File

@ -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