@@ -362,41 +362,9 @@ class ExercisesProvider with ChangeNotifier {
362
362
return exercise;
363
363
}
364
364
365
- /// Checks the required cache version
366
- ///
367
- /// This is needed since the content of the exercise cache (the API response)
368
- /// can change and we need to invalidate it as a result
369
- Future <void > checkExerciseCacheVersion () async {
370
- final prefs = await SharedPreferences .getInstance ();
371
- if (prefs.containsKey (PREFS_EXERCISE_CACHE_VERSION )) {
372
- final cacheVersion = prefs.getInt (PREFS_EXERCISE_CACHE_VERSION )! ;
373
-
374
- // Cache has has a different version, reset
375
- if (cacheVersion != CACHE_VERSION ) {
376
- database.delete (database.exercises).go ();
377
- }
378
- await prefs.setInt (PREFS_EXERCISE_CACHE_VERSION , CACHE_VERSION );
379
-
380
- // Cache has no version key, reset
381
- // Note: this is only needed for very old apps that update and could probably
382
- // be just removed in the future
383
- } else {
384
- database.delete (database.exercises).go ();
385
- await prefs.setInt (PREFS_EXERCISE_CACHE_VERSION , CACHE_VERSION );
386
- }
387
- }
388
-
389
365
Future <void > initCacheTimesLocalPrefs ({forceInit = false }) async {
390
366
final prefs = await SharedPreferences .getInstance ();
391
367
392
- // TODO: The exercise data was previously saved in PREFS_EXERCISES. This
393
- // can now be deleted. After some time when we can be sure all users
394
- // have updated their app, we can also remove this line and the
395
- // PREFS_EXERCISES constant
396
- if (prefs.containsKey (PREFS_EXERCISES )) {
397
- prefs.remove (PREFS_EXERCISES );
398
- }
399
-
400
368
final initDate = DateTime (2023 , 1 , 1 ).toIso8601String ();
401
369
402
370
if (forceInit || ! prefs.containsKey (PREFS_LAST_UPDATED_MUSCLES )) {
@@ -429,7 +397,6 @@ class ExercisesProvider with ChangeNotifier {
429
397
clear ();
430
398
431
399
await initCacheTimesLocalPrefs ();
432
- await checkExerciseCacheVersion ();
433
400
434
401
// Load categories, muscles, equipment and languages
435
402
await Future .wait ([
0 commit comments