From d0800bb31ca99e99558739457570766071bddafc Mon Sep 17 00:00:00 2001 From: Araxeus Date: Wed, 28 Apr 2021 16:58:14 +0300 Subject: [PATCH] small refactor --- plugins/taskbar-mediacontrol/back.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/taskbar-mediacontrol/back.js b/plugins/taskbar-mediacontrol/back.js index 18397b6c..46cb399e 100644 --- a/plugins/taskbar-mediacontrol/back.js +++ b/plugins/taskbar-mediacontrol/back.js @@ -8,26 +8,24 @@ let currentSongInfo; module.exports = win => { const registerCallback = getSongInfo(win); const { playPause, next, previous } = getSongControls(win); - controls = { playPause, next, previous } + controls = { playPause, next, previous }; registerCallback(songInfo => { //update currentsonginfo for win.on('show') currentSongInfo = songInfo; // update thumbar - setThumbar(win, songInfo) + setThumbar(win, songInfo); }); // need to set thumbar again after win.show win.on("show", () => { - if (currentSongInfo) { - setThumbar(win, currentSongInfo) - } + setThumbar(win, currentSongInfo) }) }; function setThumbar(win, songInfo) { // Wait for song to start before setting thumbar - if (!songInfo.title) { + if (!songInfo?.title) { return; }