From 7c6ed7bb314ad2a5bd92062a7170a242bfc0dec2 Mon Sep 17 00:00:00 2001 From: Araxeus Date: Fri, 23 Apr 2021 04:01:40 +0300 Subject: [PATCH] `once` instead of `on` --- config/defaults.js | 4 ++-- plugins/notifications/back.js | 2 +- plugins/notifications/interactive.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/defaults.js b/config/defaults.js index 57c001b1..c2465a15 100644 --- a/config/defaults.js +++ b/config/defaults.js @@ -43,9 +43,9 @@ const defaultConfig = { }, notifications: { enabled: false, - urgency: "normal", unpauseNotification: false, - interactive: false //has effect only on Windows 8+ + urgency: "normal", //has effect only on Linux + interactive: false //has effect only on Windows } }, }; diff --git a/plugins/notifications/back.js b/plugins/notifications/back.js index 38fbbbf8..901bdd1f 100644 --- a/plugins/notifications/back.js +++ b/plugins/notifications/back.js @@ -32,7 +32,7 @@ module.exports = (win, options) => { const registerCallback = getSongInfo(win); let oldNotification; let oldURL = ""; - win.on("ready-to-show", () => { + win.once("ready-to-show", () => { // Register the callback for new song information registerCallback(songInfo => { // on pause - reset url? and skip notification diff --git a/plugins/notifications/interactive.js b/plugins/notifications/interactive.js index d506463a..61f9fed0 100644 --- a/plugins/notifications/interactive.js +++ b/plugins/notifications/interactive.js @@ -13,7 +13,7 @@ module.exports.setupInteractive = (win, unpauseNotification) => { onPause = unpauseNotification; - win.webContents.on("closed", () => { + win.webContents.once("closed", () => { Delete() }); }