clarify button purpose

This commit is contained in:
Araxeus
2021-04-09 03:26:46 +03:00
parent 9c0a633677
commit 18f041f1c6
2 changed files with 5 additions and 9 deletions

View File

@ -29,12 +29,9 @@ function Delete() {
//New notification //New notification
module.exports.notifyInteractive = function sendToaster(songInfo) { module.exports.notifyInteractive = function sendToaster(songInfo) {
console.log("called toaster");
Delete(); Delete();
console.log("deleted");
//download image and get path //download image and get path
let imgSrc = notificationImage(songInfo, true); let imgSrc = notificationImage(songInfo, true);
console.log("got image");
toDelete = { toDelete = {
//app id undefined - will break buttons //app id undefined - will break buttons
title: songInfo.title || "Playing", title: songInfo.title || "Playing",
@ -42,20 +39,19 @@ module.exports.notifyInteractive = function sendToaster(songInfo) {
id: parseInt(Math.random() * 1000000, 10), id: parseInt(Math.random() * 1000000, 10),
icon: imgSrc, icon: imgSrc,
actions: [ actions: [
icons.previous, // Previous icons.previous,
songInfo.isPaused ? icons.play : icons.pause, songInfo.isPaused ? icons.play : icons.pause,
icons.next // Next icons.next
], ],
sound: false, sound: false,
}; };
console.log("sending notification");
//send notification //send notification
notifier.notify( notifier.notify(
toDelete, toDelete,
(err, data) => { (err, data) => {
// Will also wait until notification is closed. // Will also wait until notification is closed.
if (err) { if (err) {
console.log(`ERROR = ${err}\n DATA = ${data}`); console.log(`ERROR = ${err.toString()}\n DATA = ${data}`);
} }
switch (data) { switch (data) {
//buttons //buttons
@ -68,7 +64,7 @@ module.exports.notifyInteractive = function sendToaster(songInfo) {
case icons.play.normalize(): case icons.play.normalize():
controls.playPause(); controls.playPause();
// dont delete notification on play/pause // dont delete notification on play/pause
toDelete = undefined; toDelete = undefined;
//manually send notification if not sending automatically //manually send notification if not sending automatically
if (!onPause) { if (!onPause) {
songInfo.isPaused = false; songInfo.isPaused = false;

View File

@ -19,7 +19,7 @@ module.exports = (win, options) => [
}, },
...(is.windows() ? ...(is.windows() ?
[{ [{
label: "Interactive", label: "Interactive Notifications",
type: "checkbox", type: "checkbox",
checked: options.interactive, checked: options.interactive,
click: (item) => setInteractive(options, item.checked) click: (item) => setInteractive(options, item.checked)