mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 18:21:47 +00:00
make variable names clearer
This commit is contained in:
@ -4,14 +4,14 @@ const notifier = require("node-notifier");
|
|||||||
|
|
||||||
//store song controls reference on launch
|
//store song controls reference on launch
|
||||||
let controls;
|
let controls;
|
||||||
let onPause;
|
let NotificationOnPause;
|
||||||
|
|
||||||
//Save controls and onPause option
|
//Save controls and onPause option
|
||||||
module.exports.setupInteractive = (win, unpauseNotification) => {
|
module.exports.setupInteractive = (win, unpauseNotification) => {
|
||||||
const { playPause, next, previous } = getSongControls(win);
|
const { playPause, next, previous } = getSongControls(win);
|
||||||
controls = { playPause, next, previous };
|
controls = { playPause, next, previous };
|
||||||
|
|
||||||
onPause = unpauseNotification;
|
NotificationOnPause = unpauseNotification;
|
||||||
|
|
||||||
win.webContents.once("closed", () => {
|
win.webContents.once("closed", () => {
|
||||||
deleteNotification()
|
deleteNotification()
|
||||||
@ -22,6 +22,7 @@ module.exports.setupInteractive = (win, unpauseNotification) => {
|
|||||||
let toDelete;
|
let toDelete;
|
||||||
function deleteNotification() {
|
function deleteNotification() {
|
||||||
if (toDelete !== undefined) {
|
if (toDelete !== undefined) {
|
||||||
|
// To remove the notification it has to be done this way
|
||||||
const removeNotif = Object.assign(toDelete, {
|
const removeNotif = Object.assign(toDelete, {
|
||||||
remove: toDelete.id
|
remove: toDelete.id
|
||||||
})
|
})
|
||||||
@ -70,7 +71,7 @@ module.exports.notifyInteractive = function sendToaster(songInfo) {
|
|||||||
// 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 (!NotificationOnPause) {
|
||||||
songInfo.isPaused = false;
|
songInfo.isPaused = false;
|
||||||
sendToaster(songInfo);
|
sendToaster(songInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user