Skip to content

Commit

Permalink
fix: Trail Run Marathon
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-29 committed Dec 18, 2023
1 parent 6b5b1e1 commit 2e8a080
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,17 +233,23 @@ const titleForType = (type: string): string => {

const typeForRun = (run: Activity): string => {
const type = run.type
var distance = run.distance / 1000;
switch (type) {
case 'Run':
var runDistance = run.distance / 1000;
if (runDistance >= 40) {
if (distance >= 40) {
return 'Full Marathon';
}
else if (runDistance > 20) {
else if (distance > 20) {
return 'Half Marathon';
}
return 'Run';
case 'Trail Run':
if (distance >= 40) {
return 'Full Marathon';
}
else if (distance > 20) {
return 'Half Marathon';
}
return 'Trail Run';
case 'Ride':
return 'Ride';
Expand Down

0 comments on commit 2e8a080

Please sign in to comment.