From a804cf8849a8597ec874e9dc265fb8dd4938c459 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Date: Thu, 1 Aug 2024 15:41:50 +0530 Subject: [PATCH] fix zeroth index for queue --- package.json | 2 +- src/audio.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1389e80..205df3c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "audio_x", - "version": "1.0.10-beta.8", + "version": "1.0.10-beta.10", "description": "The audio player for the gen-x", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/audio.ts b/src/audio.ts index 4990368..70ca112 100644 --- a/src/audio.ts +++ b/src/audio.ts @@ -399,7 +399,7 @@ class AudioX { playPrevious() { const index = this._currentQueueIndex - 1; - if (index > 0) { + if (index >= 0) { const previousTrack = this._queue[index]; this.addMediaAndPlay(previousTrack, this._fetchFn); this._currentQueueIndex = index;