Skip to content

Commit a7e8bce

Browse files
Store times by event/course/gender only, persist across age changes
1 parent 946c915 commit a7e8bce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ <h4>Motivational Times Lookup</h4>
493493
return;
494494
}
495495

496-
const eventKey = `${appState.ageGroup}_${appState.gender}_${course}_${event.name}`;
496+
const eventKey = `${appState.gender}_${course}_${event.name}`;
497497
const userTime = appState.times[eventKey] || '';
498498
const qualification = userTime ? getQualification(userTime, times) : null;
499499

@@ -620,8 +620,8 @@ <h4>Motivational Times Lookup</h4>
620620
}
621621

622622
// Find the event's times
623-
const [age, gender, course, eventName] = eventKey.split('_');
624-
const ageGroupData = swimData.ageGroups.find(g => g.age === age);
623+
const [gender, course, eventName] = eventKey.split('_');
624+
const ageGroupData = swimData.ageGroups.find(g => g.age === appState.ageGroup);
625625
if (!ageGroupData) return;
626626

627627
const event = ageGroupData.genders[gender].events.find(e => e.name === eventName);

0 commit comments

Comments
 (0)