Skip to content

Commit

Permalink
Fix progressive overload for per set weight false
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamMorrow committed Jan 13, 2025
1 parent 4b532a4 commit 431c8dc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions LiftLog.Ui/Services/SessionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
),
Expand Down

0 comments on commit 431c8dc

Please sign in to comment.