diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2023-08-06 21:57:01 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2023-08-06 21:57:01 +0100 |
| commit | 15c761fbff203780e09fa2bc7e69c32f45e62be2 (patch) | |
| tree | bf00b8ce288361037a9d6a6843dbe6e1aa7b006b | |
| parent | 8d340cdbc85773c72bd78da0610d8be1a19d38ec (diff) | |
Fix undefined on spotify
| -rw-r--r-- | static/scripts/spotify.js | 5 |
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; |
