fix(audio): fix auto-next reliability issues
- Clear autoStartPending if goto() fails to avoid spurious auto-starts on future navigations - Clear audioStore.nextChapter on AudioPlayer unmount so a stale chapter can't trigger navigation after leaving a chapter page - Remove redundant nextChapter write in startPlayback() — the already keeps it in sync
This commit is contained in:
@@ -179,9 +179,11 @@
|
||||
audioStore.isPlaying = false;
|
||||
saveAudioTime();
|
||||
if (audioStore.autoNext && audioStore.nextChapter !== null && audioStore.slug) {
|
||||
audioStore.autoStartPending = true;
|
||||
goto(`/books/${audioStore.slug}/chapters/${audioStore.nextChapter}`);
|
||||
}
|
||||
audioStore.autoStartPending = true;
|
||||
goto(`/books/${audioStore.slug}/chapters/${audioStore.nextChapter}`).catch(() => {
|
||||
audioStore.autoStartPending = false;
|
||||
});
|
||||
}
|
||||
}}
|
||||
preload="metadata"
|
||||
style="display:none"
|
||||
|
||||
Reference in New Issue
Block a user