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:
2026-06-12 22:49:24 +09:00
parent 8555397c43
commit b5134ef86d
3 changed files with 8 additions and 8 deletions
+7 -3
View File
@@ -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.
-5
View File
@@ -21,11 +21,6 @@ class HomeScreen extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
ref.listen(seasonRefreshProvider, (_, next) {
if (next is AsyncData<bool> && next.value == true) {
ref.invalidate(seasonsProvider);
}
});
final l10n = AppLocalizations.of(context)!;
final streak = ref.watch(streakProvider);
final best = ref.watch(endlessBestProvider);