mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
discord set inactivity timeout prompt
This commit is contained in:
@ -89,7 +89,7 @@
|
||||
"async-mutex": "^0.3.2",
|
||||
"browser-id3-writer": "^4.4.0",
|
||||
"chokidar": "^3.5.2",
|
||||
"custom-electron-prompt": "^1.4.0",
|
||||
"custom-electron-prompt": "^1.4.1",
|
||||
"custom-electron-titlebar": "^3.2.10",
|
||||
"discord-rpc": "^3.2.0",
|
||||
"electron-better-web-request": "^1.0.1",
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
const { setOptions } = require("../../config/plugins");
|
||||
const { edit } = require("../../config");
|
||||
const prompt = require("custom-electron-prompt");
|
||||
const promptOptions = require("../../providers/prompt-options");
|
||||
const { clear, connect, registerRefresh, isConnected } = require("./back");
|
||||
|
||||
let hasRegisterred = false;
|
||||
@ -39,9 +40,25 @@ module.exports = (win, options, refreshMenu) => {
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Set timeout time in config",
|
||||
// open config.json
|
||||
click: edit,
|
||||
label: "Set inactivity timeout",
|
||||
click: () => setInactivityTimeout(win, options),
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
async function setInactivityTimeout(win, options) {
|
||||
let output = await prompt({
|
||||
title: 'Set Inactivity Timeout',
|
||||
label: 'Enter inactivity timeout in seconds:',
|
||||
value: Math.round((options.activityTimoutTime ?? 0) / 1e3),
|
||||
type: "counter",
|
||||
counterOptions: { minimum: 0, multiFire: true },
|
||||
width: 450,
|
||||
...promptOptions()
|
||||
}, win)
|
||||
|
||||
if (output) {
|
||||
options.activityTimoutTime = Math.round(output * 1e3);
|
||||
setOptions("discord", options);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2686,10 +2686,10 @@ cssstyle@^2.3.0:
|
||||
dependencies:
|
||||
cssom "~0.3.6"
|
||||
|
||||
custom-electron-prompt@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/custom-electron-prompt/-/custom-electron-prompt-1.4.0.tgz#04d261372807b87ec07ed12e990306d5debd5667"
|
||||
integrity sha512-tqDa3yDILVI3xxwNRW1m2fyQgdMYtFcnl1d3uMx8Tt6sQ9zG+Y4n/ie4VbttQaq7dJvFCu9K3JX65K8hfaSf1g==
|
||||
custom-electron-prompt@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/custom-electron-prompt/-/custom-electron-prompt-1.4.1.tgz#79adc3d5cd9a372e5dfe43b21de70f0fe7d1c2f7"
|
||||
integrity sha512-bR6JhEusBxKnooXfFFlIIUhDbF23eaDhaYwvqcw3ZTcdEzzJew63+ilwhIwD7flRAO+sCroaLwP495VBexHg/A==
|
||||
|
||||
custom-electron-titlebar@^3.2.10:
|
||||
version "3.2.10"
|
||||
|
||||
Reference in New Issue
Block a user