From 421fe6793022386ef21707e78f56739f5689ecf1 Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Sun, 4 Apr 2021 02:46:12 +0300 Subject: [PATCH] ignore proxy if equal to example --- menu.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/menu.js b/menu.js index 9deef729..9dd0b8e2 100644 --- a/menu.js +++ b/menu.js @@ -310,11 +310,12 @@ module.exports.setApplicationMenu = (win) => { }; const iconPath = path.join(__dirname, "assets", "youtube-music-tray.png"); +const example = `Example: "socks5://127.0.0.1:9999"`; function setProxy(item) { prompt({ title: 'Set Proxy', - label: 'Enter Proxy Adress:', - value: config.get("options.proxy") || `Example - "socks5://127.0.0.1:9999"`, + label: 'Enter Proxy Adress (or leave empty to disable)', + value: config.get("options.proxy") || example, inputAttrs: { type: 'text' }, @@ -323,7 +324,7 @@ function setProxy(item) { icon: iconPath }) .then((input) => { - if(input !== null) { + if(input !== null && input !== example) { config.set("options.proxy", input); item.checked = (input === "") ? false : true; } else { //user pressed cancel