mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 15:02:42 +01:00
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:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user