mirror of
https://github.com/lichess-org/mobile.git
synced 2026-05-26 13:50:52 +00:00
cache team standings for some time
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:lichess_mobile/src/model/broadcast/broadcast.dart';
|
||||
import 'package:lichess_mobile/src/model/broadcast/broadcast_repository.dart';
|
||||
import 'package:lichess_mobile/src/model/common/id.dart';
|
||||
import 'package:lichess_mobile/src/network/http.dart';
|
||||
|
||||
/// A provider that fetches a paginated list of broadcasts.
|
||||
final broadcastsPaginatorProvider =
|
||||
@@ -110,5 +111,8 @@ final broadcastTeamStandingsProvider = FutureProvider.autoDispose
|
||||
Ref ref,
|
||||
BroadcastTournamentId tournamentId,
|
||||
) {
|
||||
return ref.read(broadcastRepositoryProvider).getTeamStandings(tournamentId);
|
||||
return ref.withClientCacheFor(
|
||||
(client) => ref.read(broadcastRepositoryProvider).getTeamStandings(tournamentId),
|
||||
const Duration(seconds: 30),
|
||||
);
|
||||
}, name: 'BroadcastTeamStandingsProvider');
|
||||
|
||||
Reference in New Issue
Block a user