From 93c3292a467e1afcf04e5be518d586602488d4e1 Mon Sep 17 00:00:00 2001 From: Kyle Shanks Date: Thu, 11 Apr 2024 18:07:41 -0400 Subject: [PATCH] [C-4268] Fix player sagas prev functionality for premium track previews (#8094) --- packages/web/src/common/store/player/sagas.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/web/src/common/store/player/sagas.ts b/packages/web/src/common/store/player/sagas.ts index 2a28f1b7d63..0800b3c2f70 100644 --- a/packages/web/src/common/store/player/sagas.ts +++ b/packages/web/src/common/store/player/sagas.ts @@ -56,8 +56,14 @@ const { error: errorAction } = playerActions -const { getTrackId, getUid, getCounter, getPlaying, getPlaybackRate } = - playerSelectors +const { + getTrackId, + getUid, + getCounter, + getPlaying, + getPlaybackRate, + getPreviewing +} = playerSelectors const { recordListen } = tracksSocialActions const { getTrack } = cacheTracksSelectors @@ -261,11 +267,14 @@ export function* watchReset() { } else { const playerUid = yield* select(getUid) const playerTrackId = yield* select(getTrackId) + const isPreviewing = yield* select(getPreviewing) if (playerUid && playerTrackId) { yield* put( play({ uid: playerUid, trackId: playerTrackId, + // NOTE: isPreviewing can be passed as isPreview here bc we are restarting the track + isPreview: isPreviewing, onEnd: queueActions.next }) )