diff --git a/menu.js b/menu.js index 15b99bf9..bca09e7b 100644 --- a/menu.js +++ b/menu.js @@ -335,10 +335,10 @@ function setProxy(item, win) { }); } prompt(options, win) - .then(input => { - if (input !== null && input !== example) { - config.set("options.proxy", input); - item.checked = input !== ""; + .then(output => { + if (output !== null && output !== example) { + config.set("options.proxy", output); + item.checked = output !== ""; } else { //user pressed cancel item.checked = !item.checked; //reset checkbox } diff --git a/package.json b/package.json index 73a52902..931c3e8a 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "YoutubeNonStop": "git://github.com/lawfx/YoutubeNonStop.git#v0.9.0", "async-mutex": "^0.3.1", "browser-id3-writer": "^4.4.0", - "custom-electron-prompt": "^1.0.4", + "custom-electron-prompt": "^1.0.5", "custom-electron-titlebar": "^3.2.6", "discord-rpc": "^3.2.0", "electron-debug": "^3.2.0", diff --git a/plugins/precise-volume/menu.js b/plugins/precise-volume/menu.js index 1919052f..bfe73265 100644 --- a/plugins/precise-volume/menu.js +++ b/plugins/precise-volume/menu.js @@ -37,25 +37,6 @@ const customTitlebarPath = path.join(app.getAppPath(), "plugins", "in-app-menu", // Helper function for globalShortcuts prompt const kb = (label_, value_, default_) => { return { value: value_, label: label_, default: default_ || undefined }; }; -function setupPromptOptions(options) { - // TODO Custom titlebar needs testing on macOS - if (is.macOS()) { - Object.assign(options, { - customStylesheet: "dark", - icon: iconPath - }); - } else { - Object.assign(options, { - customStylesheet: "dark", - icon: iconPath, - // The following are used for custom titlebar - frame: false, - customScript: customTitlebarPath, - enableRemoteModule: true - }); - } -} - function promptVolumeSteps(win, options) { const promptOptions = { title: "Volume Steps", @@ -67,12 +48,13 @@ function promptVolumeSteps(win, options) { setupPromptOptions(promptOptions); - prompt(promptOptions, win).then(input => { - if (input || input === 0) { // 0 is somehow valid - options.steps = input; - setOptions("precise-volume", options); - } - }).catch(console.error); + prompt(promptOptions, win) + .then(output => { + if (output || output === 0) { // 0 is somehow valid + options.steps = output; + setOptions("precise-volume", options); + } + }).catch(console.error); } function promptGlobalShortcuts(win, options, item) { @@ -106,3 +88,22 @@ function promptGlobalShortcuts(win, options, item) { }) .catch(console.error); } + +function setupPromptOptions(options) { + // TODO Custom titlebar needs testing on macOS + if (is.macOS()) { + Object.assign(options, { + customStylesheet: "dark", + icon: iconPath + }); + } else { + Object.assign(options, { + customStylesheet: "dark", + icon: iconPath, + // The following are used for custom titlebar + frame: false, + customScript: customTitlebarPath, + enableRemoteModule: true + }); + } +} diff --git a/yarn.lock b/yarn.lock index ae0a453b..e513ddc4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2849,10 +2849,10 @@ cssstyle@^2.2.0: dependencies: cssom "~0.3.6" -custom-electron-prompt@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/custom-electron-prompt/-/custom-electron-prompt-1.0.4.tgz#b729cb10687b8fa9029e82d68652fd94e59b1918" - integrity sha512-Yj73jce2Sx7+ngnqGvth0aBuD6vx/QLrkziLJ5Iznh+n3qRrWnO1Qz+dJCdThCvobO5VUAbTXbHebtLuKj+7qw== +custom-electron-prompt@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/custom-electron-prompt/-/custom-electron-prompt-1.0.5.tgz#2b72ac108f3038bab3757345f8faee3cd91b1f43" + integrity sha512-BEAlGVf7obLmAwSO/rgnWvLQxtYaPEXSu79XySx0qRuR7WEYdQgJdBpycQF+3ivjv8oRe5f4pjxaxu657fs+mg== custom-electron-titlebar@^3.2.6: version "3.2.6"