From 7a6208cc0b9f231c9af8a06c5b2b3518b08f1598 Mon Sep 17 00:00:00 2001 From: Motsoaledi Neo Tshoana Date: Sat, 2 May 2026 20:12:24 +0200 Subject: [PATCH] fix(audio): reset playback state on chapter change --- apps/web/src/app/(app)/reader/[bookId]/page.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/web/src/app/(app)/reader/[bookId]/page.tsx b/apps/web/src/app/(app)/reader/[bookId]/page.tsx index e18b79f..e01ad15 100644 --- a/apps/web/src/app/(app)/reader/[bookId]/page.tsx +++ b/apps/web/src/app/(app)/reader/[bookId]/page.tsx @@ -232,11 +232,14 @@ export default function ReaderPage() { const newChapter = currentChapter - 1; setCurrentChapter(newChapter); setCurrentScrollProgress(0); + setCurrentAudioTime(0); + setCurrentAudioChunk(null); updateProgress({ chapterIndex: newChapter, chapterId: structure?.chapters[newChapter]?.id, scrollPosition: 0, audioTimestamp: 0, + audioChunkId: undefined, }); } }; @@ -246,11 +249,14 @@ export default function ReaderPage() { const newChapter = currentChapter + 1; setCurrentChapter(newChapter); setCurrentScrollProgress(0); + setCurrentAudioTime(0); + setCurrentAudioChunk(null); updateProgress({ chapterIndex: newChapter, chapterId: structure?.chapters[newChapter]?.id, scrollPosition: 0, audioTimestamp: 0, + audioChunkId: undefined, }); } };