ignore proxy if equal to example

This commit is contained in:
Araxeus
2021-04-04 02:46:12 +03:00
parent 8291cdfc12
commit 421fe67930

View File

@ -310,11 +310,12 @@ module.exports.setApplicationMenu = (win) => {
}; };
const iconPath = path.join(__dirname, "assets", "youtube-music-tray.png"); const iconPath = path.join(__dirname, "assets", "youtube-music-tray.png");
const example = `Example: "socks5://127.0.0.1:9999"`;
function setProxy(item) { function setProxy(item) {
prompt({ prompt({
title: 'Set Proxy', title: 'Set Proxy',
label: 'Enter Proxy Adress:', label: 'Enter Proxy Adress (or leave empty to disable)',
value: config.get("options.proxy") || `Example - "socks5://127.0.0.1:9999"`, value: config.get("options.proxy") || example,
inputAttrs: { inputAttrs: {
type: 'text' type: 'text'
}, },
@ -323,7 +324,7 @@ function setProxy(item) {
icon: iconPath icon: iconPath
}) })
.then((input) => { .then((input) => {
if(input !== null) { if(input !== null && input !== example) {
config.set("options.proxy", input); config.set("options.proxy", input);
item.checked = (input === "") ? false : true; item.checked = (input === "") ? false : true;
} else { //user pressed cancel } else { //user pressed cancel