From 15c761fbff203780e09fa2bc7e69c32f45e62be2 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Sun, 6 Aug 2023 21:57:01 +0100 Subject: Fix undefined on spotify --- static/scripts/spotify.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/scripts/spotify.js b/static/scripts/spotify.js index 662e833..6a6aec6 100644 --- a/static/scripts/spotify.js +++ b/static/scripts/spotify.js @@ -48,6 +48,7 @@ const setDefaultData = () => { songAlbumArt.src = '/images/blank-album-cover.png'; setProgress(0, 0); + setOpenInSpotify(null); } const setOpenInSpotify = (songUrl) => { @@ -87,6 +88,10 @@ const connectWebsocket = () => { progressMillis = data.progress; durationMillis = data.duration; + if (!data.title) { + setDefaultData(); + return; + } songTitle.innerHTML = data.title; songArtist.innerHTML = data.artist; songAlbum.innerHTML = data.album; -- cgit v1.2.3-70-g09d2