aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/client.html10
1 files changed, 8 insertions, 2 deletions
diff --git a/web/client.html b/web/client.html
index 91ce11d..c0aef1f 100644
--- a/web/client.html
+++ b/web/client.html
@@ -202,9 +202,15 @@
playing = document.getElementById("playing").innerHTML = "";
}
- function handlePlay(currentSong) {
+ function handlePlay(_currentSongs) {
{{if .IsAdmin}} document.getElementById("ppbutton").innerHTML = 'Pause'; {{end}}
+ if (_currentSongs == null || _currentSongs.length == 0) {
+ return;
+ }
+
+ const currentSong = _currentSongs[0]
+
idx = -1;
songs.forEach(function(s, i, a) { if (s.uri == currentSong.uri) idx = i; });
if (idx != -1) {
@@ -251,7 +257,7 @@
handleStop()
break;
case "play":
- handlePlay(cmd.songs[0])
+ handlePlay(cmd.songs)
break;
case "upvoted":
handleVotes("up", cmd.songs)