mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-15 04:11:47 +00:00
Add advanced configuration menu for notifications
This commit is contained in:
13
plugins/notifications/menu.js
Normal file
13
plugins/notifications/menu.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
const {urgencyLevels, setUrgency} = require("./utils");
|
||||||
|
|
||||||
|
module.exports = (win, options) => [
|
||||||
|
{
|
||||||
|
label: "Notification Priority",
|
||||||
|
submenu: urgencyLevels.map(level => ({
|
||||||
|
label: level.name,
|
||||||
|
type: "radio",
|
||||||
|
checked: options.urgency === level.value,
|
||||||
|
click: () => setUrgency(options, level.value)
|
||||||
|
})),
|
||||||
|
},
|
||||||
|
];
|
||||||
11
plugins/notifications/utils.js
Normal file
11
plugins/notifications/utils.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
const {setOptions} = require("../../config/plugins");
|
||||||
|
|
||||||
|
module.exports.urgencyLevels = [
|
||||||
|
{name: "Low", value: "low"},
|
||||||
|
{name: "Normal", value: "normal"},
|
||||||
|
{name: "High", value: "critical"},
|
||||||
|
];
|
||||||
|
module.exports.setUrgency = (options, level) => {
|
||||||
|
options.urgency = level
|
||||||
|
setOptions("notifications", options)
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user