Skip to content

Commit 4b0c611

Browse files
committed
Resume when paused and clicking prev track
1 parent 7fb7704 commit 4b0c611

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/hooks/useLibrespot.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ const useLibrespot = (websocketUrl, apiBaseUrl) => {
9191
console.error("Unable to skip back, as the player is inactive.");
9292
return;
9393
}
94+
if (!isPlaying) {
95+
resume();
96+
}
9497
previousTrack();
9598
};
9699

@@ -100,11 +103,11 @@ const useLibrespot = (websocketUrl, apiBaseUrl) => {
100103
console.error("Unable to skip track, as the player is inactive.");
101104
return;
102105
}
103-
seek(trackInfo.duration - 5);
104-
setRemotePosition(trackInfo.duration - 5);
105106
if (!isPlaying) {
106107
resume();
107108
}
109+
seek(trackInfo.duration - 5);
110+
setRemotePosition(trackInfo.duration - 5);
108111
};
109112

110113
// Seeks to a % of the current duration.

0 commit comments

Comments
 (0)