Skip to content

Commit

Permalink
Merge pull request #299 from LiamMorrow/dont-interrupt-plan-with-free…
Browse files Browse the repository at this point in the history
…form
  • Loading branch information
LiamMorrow authored Oct 15, 2024
2 parents 60c31a3 + 88984df commit e7a9de7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions LiftLog.Lib/Models/SessionModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ public RecordedExercise? NextExercise
RecordedExercises.Sum(ex =>
ex.PotentialSets.Sum(set => (set.Set?.RepsCompleted ?? 0) * set.Weight)
);

public bool IsFreeform => Blueprint.Name == "Freeform Session";
}

public record RecordedExercise(
Expand Down
4 changes: 3 additions & 1 deletion LiftLog.Ui/Services/SessionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ ImmutableListValue<SessionBlueprint> sessionBlueprints
var latestSession = currentSession switch
{
{ IsStarted: true } => currentSession,
_ => await progressRepository.GetOrderedSessions().FirstOrDefaultAsync(),
_ => await progressRepository
.GetOrderedSessions()
.FirstOrDefaultAsync(x => !x.IsFreeform),
};
if (latestSession == null)
{
Expand Down

0 comments on commit e7a9de7

Please sign in to comment.