fix(ui): save play mode for player (#3315)

* fix(ui): save play mode for player - 3019

* redux

* redux
This commit is contained in:
Kendall Garner
2024-09-27 17:13:22 +00:00
committed by GitHub
parent 10a1b5faf8
commit 782cd26b3d
5 changed files with 33 additions and 4 deletions
+10 -2
View File
@@ -16,7 +16,13 @@ import useCurrentTheme from '../themes/useCurrentTheme'
import config from '../config'
import useStyle from './styles'
import AudioTitle from './AudioTitle'
import { clearQueue, currentPlaying, setVolume, syncQueue } from '../actions'
import {
clearQueue,
currentPlaying,
setPlayMode,
setVolume,
syncQueue,
} from '../actions'
import PlayerToolbar from './PlayerToolbar'
import { sendNotification } from '../utils'
import subsonic from '../subsonic'
@@ -93,6 +99,7 @@ const Player = () => {
() => ({
theme: playerTheme,
bounds: 'body',
playMode: playerState.mode,
mode: 'full',
loadAudioErrorPlayNext: false,
autoPlayInitLoadPlayList: true,
@@ -121,7 +128,7 @@ const Player = () => {
),
locale: locale(translate),
}),
[gainInfo, isDesktop, playerTheme, translate],
[gainInfo, isDesktop, playerTheme, translate, playerState.mode],
)
const options = useMemo(() => {
@@ -294,6 +301,7 @@ const Player = () => {
onAudioPlay={onAudioPlay}
onAudioPlayTrackChange={onAudioPlayTrackChange}
onAudioPause={onAudioPause}
onPlayModeChange={(mode) => dispatch(setPlayMode(mode))}
onAudioEnded={onAudioEnded}
onCoverClick={onCoverClick}
onBeforeDestroy={onBeforeDestroy}