From 431c8dcdc8487cd81ad1841607b79098d1200dcf Mon Sep 17 00:00:00 2001 From: Liam Morrow Date: Mon, 13 Jan 2025 15:04:05 +1100 Subject: [PATCH] Fix progressive overload for per set weight false --- LiftLog.Ui/Services/SessionService.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/LiftLog.Ui/Services/SessionService.cs b/LiftLog.Ui/Services/SessionService.cs index a637f193..982efcc4 100644 --- a/LiftLog.Ui/Services/SessionService.cs +++ b/LiftLog.Ui/Services/SessionService.cs @@ -95,13 +95,14 @@ RecordedExercise GetNextExercise(ExerciseBlueprint e) var lastExercise = latestRecordedExercises.GetValueOrDefault(e); var potentialSets = lastExercise switch { - null or { PerSetWeight: false } => Enumerable.Repeat( - new PotentialSet( - null, - lastExercise?.PotentialSets.FirstOrDefault()?.Weight ?? 0 + null or { PerSetWeight: false, IsSuccessForProgressiveOverload: false } => + Enumerable.Repeat( + new PotentialSet( + null, + lastExercise?.PotentialSets.FirstOrDefault()?.Weight ?? 0 + ), + e.Sets ), - e.Sets - ), { IsSuccessForProgressiveOverload: true } => lastExercise.PotentialSets.Select( x => new PotentialSet(null, x.Weight + e.WeightIncreaseOnSuccess) ),