diff --git a/lib/features/player/providers/currently_playing_provider.dart b/lib/features/player/providers/currently_playing_provider.dart index 68b5c10..607b823 100644 --- a/lib/features/player/providers/currently_playing_provider.dart +++ b/lib/features/player/providers/currently_playing_provider.dart @@ -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; } diff --git a/lib/features/player/providers/currently_playing_provider.g.dart b/lib/features/player/providers/currently_playing_provider.g.dart index 11485b7..afcbb8c 100644 --- a/lib/features/player/providers/currently_playing_provider.g.dart +++ b/lib/features/player/providers/currently_playing_provider.g.dart @@ -24,7 +24,7 @@ final currentlyPlayingBookProvider = typedef CurrentlyPlayingBookRef = AutoDisposeProviderRef; String _$currentPlayingChapterHash() => - r'3a621260211cddecfd974b31d5c4820ed24b1545'; + r'91ca01ee93e0d556c77237ceebb3f9281d2d2b3f'; /// provided the current chapter of the book being played ///