Skip to content

Commit

Permalink
C-2483 Fix queue overshot empty track player bug (#3353)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikki Kang <kangaroo233@gmail.com>
  • Loading branch information
nicoback2 and nicoback committed May 17, 2023
1 parent 3d265f9 commit a456874
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
8 changes: 3 additions & 5 deletions apps/audius-client/packages/common/src/store/queue/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,9 @@ const slice = createSlice({
state.index = 0
return
}
if (!state.queueAutoplay) {
// Reset to last track
state.overshot = true
return
}
// Reset to last track
state.overshot = true
return
}

state.index = state.index + 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,12 @@ function* handleQueueAutoplay({
const length = yield* select(getLength)
const shuffle = yield* select(getShuffle)
const repeatMode = yield* select(getRepeat)
const isCloseToEndOfQueue = index + 1 >= length
const isOnlySongInQueue = index === 0 && length === 1
const isCloseToEndOfQueue = index + 9 >= length
const isNotRepeating =
repeatMode === RepeatMode.OFF ||
(repeatMode === RepeatMode.SINGLE && (skip || ignoreSkip))

if (
!shuffle &&
isNotRepeating &&
(isCloseToEndOfQueue || isOnlySongInQueue)
) {
if (!shuffle && isNotRepeating && isCloseToEndOfQueue) {
yield* waitForAccount()
const userId = yield* select(getUserId)
yield* put(
Expand Down

0 comments on commit a456874

Please sign in to comment.