move checks into platform check

This commit is contained in:
Lucas Duarte Sobreira 2021-12-22 09:39:58 -03:00
parent 4b34b582f8
commit 574b4a61a4

View file

@ -339,19 +339,15 @@ const app = new Vue({
app.loadLyrics()
// Playback Notifications
if ((app.platform === "darwin" || app.platform === "linux") && !document.hasFocus()) {
if ((app.platform === "darwin" || app.platform === "linux") && !document.hasFocus() && a.artistName && a.artwork && a.name) {
if (this.notification) {
this.notification.close()
}
if (a.artistName && a.artwork && a.name) {
this.notification = new Notification(a.name, {
body: a.artistName,
icon: a.artwork.url
.replace('/{w}x{h}bb', '/512x512bb')
.replace('/2000x2000bb', '/35x35bb'),
silent: true,
});
}
this.notification = new Notification(a.name, {
body: a.artistName,
icon: a.artwork.url.replace('/{w}x{h}bb', '/512x512bb').replace('/2000x2000bb', '/35x35bb'),
silent: true,
});
}
})