mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Correctly fetch the synthetic repetitions when creating a workout
This commit is contained in:
@@ -311,7 +311,6 @@ class WorkoutPlans extends WgerBaseProvider with ChangeNotifier {
|
||||
Future<Set> addSet(Set workoutSet) async {
|
||||
final data = await post(workoutSet.toJson(), makeUrl(_setsUrlPath));
|
||||
final set = Set.fromJson(data);
|
||||
fetchComputedSettings(set);
|
||||
notifyListeners();
|
||||
return set;
|
||||
}
|
||||
|
||||
@@ -383,13 +383,17 @@ class _SetFormWidgetState extends State<SetFormWidget> {
|
||||
for (var setting in widget._set.settings) {
|
||||
setting.setId = setDb.id!;
|
||||
setting.comment = '';
|
||||
setting.repsText = 'temp text';
|
||||
|
||||
Setting settingDb = await workoutProvider.addSetting(setting);
|
||||
setting.repsText = await workoutProvider.fetchSmartText(
|
||||
widget._set,
|
||||
setting.exerciseObj,
|
||||
);
|
||||
setting.id = settingDb.id;
|
||||
}
|
||||
|
||||
// Add to workout day
|
||||
workoutProvider.fetchComputedSettings(widget._set);
|
||||
widget._day.sets.add(widget._set);
|
||||
|
||||
// Close the bottom sheet
|
||||
|
||||
Reference in New Issue
Block a user