mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
once instead of on
This commit is contained in:
@ -43,9 +43,9 @@ const defaultConfig = {
|
|||||||
},
|
},
|
||||||
notifications: {
|
notifications: {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
urgency: "normal",
|
|
||||||
unpauseNotification: false,
|
unpauseNotification: false,
|
||||||
interactive: false //has effect only on Windows 8+
|
urgency: "normal", //has effect only on Linux
|
||||||
|
interactive: false //has effect only on Windows
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -32,7 +32,7 @@ module.exports = (win, options) => {
|
|||||||
const registerCallback = getSongInfo(win);
|
const registerCallback = getSongInfo(win);
|
||||||
let oldNotification;
|
let oldNotification;
|
||||||
let oldURL = "";
|
let oldURL = "";
|
||||||
win.on("ready-to-show", () => {
|
win.once("ready-to-show", () => {
|
||||||
// Register the callback for new song information
|
// Register the callback for new song information
|
||||||
registerCallback(songInfo => {
|
registerCallback(songInfo => {
|
||||||
// on pause - reset url? and skip notification
|
// on pause - reset url? and skip notification
|
||||||
|
|||||||
@ -13,7 +13,7 @@ module.exports.setupInteractive = (win, unpauseNotification) => {
|
|||||||
|
|
||||||
onPause = unpauseNotification;
|
onPause = unpauseNotification;
|
||||||
|
|
||||||
win.webContents.on("closed", () => {
|
win.webContents.once("closed", () => {
|
||||||
Delete()
|
Delete()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user