mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-12 21:05:29 +01:00
Fix Queue.removeCurrent()
This commit is contained in:
parent
7f39642c49
commit
3de34e5e4a
|
@ -57,6 +57,7 @@ export default class {
|
|||
queue.removeCurrent();
|
||||
|
||||
if (isPlaying) {
|
||||
queue.back();
|
||||
await player.seek(oldPosition);
|
||||
} else {
|
||||
player.disconnect();
|
||||
|
|
|
@ -19,7 +19,7 @@ export default class {
|
|||
private position = 0;
|
||||
|
||||
forward(): void {
|
||||
if (this.position <= this.size() + 1) {
|
||||
if (this.position < this.size() + 1) {
|
||||
this.position++;
|
||||
} else {
|
||||
throw new Error('No songs in queue to forward to.');
|
||||
|
@ -85,10 +85,6 @@ export default class {
|
|||
|
||||
removeCurrent(): void {
|
||||
this.queue = [...this.queue.slice(0, this.position), ...this.queue.slice(this.position + 1)];
|
||||
|
||||
if (this.position !== 0) {
|
||||
this.position--;
|
||||
}
|
||||
}
|
||||
|
||||
size(): number {
|
||||
|
|
Loading…
Reference in a new issue