share weekKey extension and log splash precache failures
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../../../../../api/marianumconnect/queries/timetable_custom_events/custom_events_migration.dart';
|
||||
import '../../../../../api/marianumconnect/queries/timetable_get_week/timetable_get_week_response.dart';
|
||||
import '../../../../../api/mhsl/custom_timetable_event/custom_timetable_event.dart';
|
||||
@@ -19,8 +17,6 @@ class TimetableBloc
|
||||
TimetableState,
|
||||
TimetableRepository
|
||||
> {
|
||||
static final DateFormat _weekKeyFormat = DateFormat('yyyyMMdd');
|
||||
|
||||
DateTime _lastWeekRequestStart = DateTime.fromMillisecondsSinceEpoch(0);
|
||||
|
||||
/// Set by [retry] to force the next [gatherData] to bypass cache freshness
|
||||
@@ -247,7 +243,7 @@ class TimetableBloc
|
||||
}
|
||||
|
||||
void _writeWeekToCache(DateTime weekStart, TimetableGetWeekResponse week) {
|
||||
final key = _weekKeyFormat.format(weekStart);
|
||||
final key = weekStart.weekKey();
|
||||
add(
|
||||
Emit((s) {
|
||||
final updated = Map<String, TimetableGetWeekResponse>.of(s.weekCache);
|
||||
|
||||
Reference in New Issue
Block a user