check if we paused on duck before playing again (#51)

prevents music playing after an alarm or call ends if it wasn't paused by that alarm/call in the first place
This commit is contained in:
austinried
2021-12-15 13:59:58 +09:00
committed by GitHub
parent 5bb32df16b
commit da033e697f
2 changed files with 19 additions and 2 deletions

View File

@@ -42,6 +42,9 @@ export type TrackPlayerSlice = {
playerState: State
setPlayerState: (playerState: State) => void
duckPaused: boolean
setDuckPaused: (duckPaused: boolean) => void
currentTrack?: TrackExt
currentTrackIdx?: number
setCurrentTrackIdx: (idx?: number) => void
@@ -197,6 +200,9 @@ export const createTrackPlayerSlice = (set: SetState<Store>, get: GetState<Store
)
},
duckPaused: false,
setDuckPaused: duckPaused => set({ duckPaused }),
queue: [],
setQueue: async (songs, name, contextType, contextId, playTrack, shuffle) => {
return trackPlayerCommands.enqueue(async () => {