From 84df2966e18be8f827da04a4612d2d86dfb9d81f Mon Sep 17 00:00:00 2001 From: "Leah (ctucx)" Date: Fri, 5 Mar 2021 23:10:43 +0100 Subject: [PATCH] oopsie: add function that i forgot to commit --- webmusic.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webmusic.js b/webmusic.js index 24de390..03e57a3 100644 --- a/webmusic.js +++ b/webmusic.js @@ -142,6 +142,14 @@ function initState() { total = queue.length; } +function previousTrack() { + if (index-- === 0) + index = total-1; + if (continuelist) { + playSong(queue[index]) + } +} + function nextTrack() { if (++index === total) index = 0;