Skip to content

Commit

Permalink
Disable repeatSingle when repeat is disabled (#2117)
Browse files Browse the repository at this point in the history
* Fix issue where moving first item of the queue is not possible

We should not check if value is greater than 0, since then we cant move first item in the queue.

* clear repeatSingle if repeat is disabled

repeat single does not work alone, since its nested inside repeat checks and coupled with it in other checks, so it should be set false when repeat is disabled. Currently "pushState" can emit "repeatSingle == true", but if repeat is false, we are not repeating single track, so the state is wrong.

* Revert "clear repeatSingle if repeat is disabled"

This reverts commit 99b8838.

* Revert "Revert "clear repeatSingle if repeat is disabled""

This reverts commit cd426d5.

* Revert "Fix issue where moving first item of the queue is not possible"

This reverts commit 4a70181.
  • Loading branch information
Joni-Salminen authored Sep 22, 2021
1 parent 70a7521 commit 6f8166e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/statemachine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1384,10 +1384,11 @@ CoreStateMachine.prototype.setRepeat = function (value, repeatSingle) {
}
} else {
this.currentRepeat = value;

if (repeatSingle != undefined) {
this.currentRepeatSingleSong = repeatSingle;
}
if(this.currentRepeat && repeatSingle != undefined) {
this.currentRepeatSingleSong = repeatSingle;
} else {
this.currentRepeatSingleSong = false;
}

this.pushState().fail(this.pushError.bind(this));
}
Expand Down

0 comments on commit 6f8166e

Please sign in to comment.