Skip to content

Commit

Permalink
Fix the bug for 'outside workout' when keeping the last target (#32)
Browse files Browse the repository at this point in the history
Co-authored-by: Samuel Dumont <samuel@dataroots.io>
  • Loading branch information
sam-dumont and Samuel Dumont authored May 16, 2021
1 parent 565adf6 commit f9f1329
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source/RunPowerWorkoutView.mc
Original file line number Diff line number Diff line change
Expand Up @@ -548,13 +548,12 @@ class RunPowerWorkoutView extends WatchUi.DataField {
}
}
} else {
if(!keepLast){
if(!keepLast || nextTargetHigh == null || nextTargetLow == null){
nextTargetHigh = 0;
nextTargetLow = 0;
}
nextTargetType = 5;
nextTargetDuration = 0;

}

targetHigh = workout.step.targetValueHigh - 1000;
Expand Down Expand Up @@ -603,7 +602,7 @@ class RunPowerWorkoutView extends WatchUi.DataField {
}
}
} else {
if(keepLast){
if(keepLast && nextTargetLow != null && nextTargetHigh != null){
stepType = 5;
targetHigh = nextTargetHigh;
targetLow = nextTargetLow;
Expand Down

0 comments on commit f9f1329

Please sign in to comment.