aboutsummaryrefslogtreecommitdiffstats
path: root/static
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.com>2023-08-06 21:57:01 +0100
committerLeonardo Bishop <me@leonardobishop.com>2023-08-06 21:57:01 +0100
commit15c761fbff203780e09fa2bc7e69c32f45e62be2 (patch)
treebf00b8ce288361037a9d6a6843dbe6e1aa7b006b /static
parent8d340cdbc85773c72bd78da0610d8be1a19d38ec (diff)
Fix undefined on spotify
Diffstat (limited to 'static')
-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;