@@ -82,8 +82,16 @@ function addEventIDOptions(): void {
8282 }
8383}
8484
85+ function backURL ( event : EventID ) : URL {
86+ const url = new URL ( "../" , import . meta. url ) ;
87+ url . searchParams . set ( "event" , event ) ;
88+ return url ;
89+ }
90+
8591export async function showData ( ) : Promise < void > {
86- const eventId = getEventID ( ) ;
92+ const eventID = getEventID ( ) ;
93+ document . querySelector < HTMLAnchorElement > ( "#back-to-timer" ) ! . href =
94+ backURL ( eventID ) . toString ( ) ;
8795 const rangeSelector = getRangeSelector ( ) ;
8896
8997 const tableBody = document . querySelector ( "#results tbody" ) as HTMLBodyElement ;
@@ -96,7 +104,7 @@ export async function showData(): Promise<void> {
96104 unfilteredAttempts = (
97105 await session . mostRecentAttempts (
98106 MAX_NUM_RECENT_ATTEMPTS ,
99- eventId as EventID ,
107+ eventID as EventID ,
100108 rangeSelector === "most-recent" ,
101109 )
102110 ) . docs ;
@@ -108,15 +116,15 @@ export async function showData(): Promise<void> {
108116 unfilteredAttempts = await session . extremeTimes (
109117 MAX_NUM_RECENT_ATTEMPTS ,
110118 rangeSelector === "worst" ,
111- eventId as EventID ,
119+ eventID as EventID ,
112120 ) ;
113121 break ;
114122 }
115123 default :
116124 throw new Error ( "unexpected range selector" ) ;
117125 }
118126 const attempts = unfilteredAttempts . filter (
119- ( attempt : AttemptData ) => attempt . event === eventId ,
127+ ( attempt : AttemptData ) => attempt . event === eventID ,
120128 ) ;
121129 for ( const attempt of attempts ) {
122130 if ( ! attempt . totalResultMs ) {
0 commit comments