fix: season list re-reads via provider dependency; ignore pid files
seasonsProvider now watches seasonRefreshProvider instead of relying on a HomeScreen ref.listen, making the refresh ordering-independent. Removes the redundant listener from HomeScreen. Appends *.pid to .gitignore. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -41,9 +41,13 @@ final seasonFlowProvider = NotifierProvider<SeasonFlowNotifier, SeasonFlow?>(
|
||||
final contentRepositoryProvider =
|
||||
Provider<ContentRepository>((ref) => ContentRepository());
|
||||
|
||||
final seasonsProvider = FutureProvider<List<SeasonPack>>(
|
||||
(ref) => ref.read(contentRepositoryProvider).availableSeasons(),
|
||||
);
|
||||
final seasonsProvider = FutureProvider<List<SeasonPack>>((ref) {
|
||||
// Watching (not awaiting) the one-shot sync makes this provider re-run
|
||||
// once when the sync completes, picking up freshly cached packs. Local
|
||||
// content loads immediately; the network never blocks this future.
|
||||
ref.watch(seasonRefreshProvider);
|
||||
return ref.read(contentRepositoryProvider).availableSeasons();
|
||||
});
|
||||
|
||||
/// One background content sync per app session. Home listens and refreshes
|
||||
/// the season list when new packs arrived.
|
||||
|
||||
Reference in New Issue
Block a user