aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--static/scripts/spotify.js5
1 files changed, 5 insertions, 0 deletions
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;