Skip to content

Commit

Permalink
Handle tracks without exercises gracefully on journey page (#6914)
Browse files Browse the repository at this point in the history
* Handle tracks without exercises gracefully on journey page

* Update app/javascript/components/journey/types.ts
  • Loading branch information
ErikSchierboom authored May 15, 2024
1 parent 7791c78 commit 6d3eade
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/javascript/components/journey/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export class TrackProgress {
progressChart: TrackProgressChart

get completion(): number {
if (this.numExercises === 0) return 0

return (100 * this.numCompletedExercises) / this.numExercises
}

Expand Down

0 comments on commit 6d3eade

Please sign in to comment.