Skip to content

Commit

Permalink
fix: remove not returning removed track
Browse files Browse the repository at this point in the history
  • Loading branch information
larsrickert committed May 5, 2022
1 parent 6c13a67 commit 9e7ab69
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/includes/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ export class Player extends TypedEmitter<PlayerEvents> {
*/
remove(index: number): Track | undefined {
if (index < 0 || index >= this.queue.length) return;
this.queue.splice(index, 1);
const removedTracks = this.queue.splice(index, 1);
if (removedTracks.length) return removedTracks[0];
}
}

0 comments on commit 9e7ab69

Please sign in to comment.