mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-18 00:49:30 +00:00
feat: Invalidate currently playing chapter when player position changes
This commit is contained in:
parent
36509913f2
commit
74dc9807d6
2 changed files with 5 additions and 1 deletions
|
|
@ -14,6 +14,10 @@ BookExpanded? currentlyPlayingBook(CurrentlyPlayingBookRef ref) {
|
|||
@riverpod
|
||||
BookChapter? currentPlayingChapter(CurrentPlayingChapterRef ref) {
|
||||
final player = ref.watch(audiobookPlayerProvider);
|
||||
player.positionStream.listen((_) {
|
||||
ref.invalidateSelf();
|
||||
});
|
||||
|
||||
return player.currentChapter;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue