Fix pausing after playing a few tracks (#94)

we only get this error when playing so we should always keep playing
This commit is contained in:
austinried 2022-04-12 09:45:38 +09:00 committed by GitHub
parent c1a4b5ede8
commit f39a29159a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,9 +28,9 @@ const setNetState = (netState: 'mobile' | 'wifi') => {
}) })
} }
const rebuildQueue = () => { const rebuildQueue = (forcePlay?: boolean) => {
unstable_batchedUpdates(() => { unstable_batchedUpdates(() => {
useStore.getState().rebuildQueue(useStore.getState().playerState === State.Playing) useStore.getState().rebuildQueue(forcePlay)
}) })
} }
@ -139,7 +139,7 @@ const createService = async () => {
// fix for ExoPlayer aborting playback while esimating content length // fix for ExoPlayer aborting playback while esimating content length
if (code === 'playback-source' && message.includes('416')) { if (code === 'playback-source' && message.includes('416')) {
rebuildQueue() rebuildQueue(true)
} }
}) })
} }