Add advanced configuration menu for notifications

This commit is contained in:
SapuSeven
2021-03-28 23:33:10 +02:00
parent 8dc18bbe5e
commit 1a338fb9e5
2 changed files with 24 additions and 0 deletions

View 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)
})),
},
];

View 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)
};