diff --git a/lib/features/routines/models/workout_progress.dart b/lib/features/routines/models/workout_progress.dart index 76ffa86d5..174cf4442 100644 --- a/lib/features/routines/models/workout_progress.dart +++ b/lib/features/routines/models/workout_progress.dart @@ -21,10 +21,8 @@ import 'package:freezed_annotation/freezed_annotation.dart'; part 'workout_progress.freezed.dart'; part 'workout_progress.g.dart'; -/// The progress through a running workout, as stored in the preferences -/// -/// Only the parts that can't be recalculated are kept. The pages are derived -/// from the routine again and matched by their keys. +/// The progress through a running workout, as stored in the preferences. The +/// pages themselves are derived from the routine again and matched by key. @freezed sealed class WorkoutProgress with _$WorkoutProgress { const factory WorkoutProgress({ diff --git a/lib/features/routines/providers/gym_state_notifier.dart b/lib/features/routines/providers/gym_state_notifier.dart index 0228b2b24..7b9dff9e2 100644 --- a/lib/features/routines/providers/gym_state_notifier.dart +++ b/lib/features/routines/providers/gym_state_notifier.dart @@ -147,11 +147,8 @@ class GymStateNotifier extends _$GymStateNotifier { ); } - /// Stores the progress through the running workout - /// - /// Riverpod keeps the state alive for as long as the app is running, but the - /// OS can kill a backgrounded app at any point, e.g. while the user switches - /// to a music app between two sets. + /// Stores the progress through the running workout, since the OS can kill a + /// backgrounded app at any point, e.g. between two sets Future _saveProgress() async { // Before initData there is no dayId to store the progress under if (!state.isInitialized) { @@ -186,10 +183,8 @@ class GymStateNotifier extends _$GymStateNotifier { _logger.finer('Cleared stored workout progress'); } - /// Opens gym mode for a day and returns the page to start on - /// - /// Continues the workout still in memory as it is, otherwise starts a new one - /// that picks up the progress stored before the app was killed, if any. + /// Opens gym mode for a day and returns the page to start on. Continues the + /// workout in memory, otherwise starts one that picks up any stored progress. Future open(Routine routine, int dayId, int iteration) async { final resume = _canResume(dayId); final initialPage = initData(routine, dayId, iteration); diff --git a/lib/features/routines/providers/gym_state_notifier.g.dart b/lib/features/routines/providers/gym_state_notifier.g.dart index 8ffd11a9c..bf7e610e1 100644 --- a/lib/features/routines/providers/gym_state_notifier.g.dart +++ b/lib/features/routines/providers/gym_state_notifier.g.dart @@ -40,7 +40,7 @@ final class GymStateNotifierProvider extends $NotifierProvider r'1f0009a2972509e3a444896208f3865835ba77a7'; +String _$gymStateNotifierHash() => r'd677a108bd0fa3ae52320cfbf6855ae25bdbc6fe'; abstract class _$GymStateNotifier extends $Notifier { GymModeState build();