File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,12 @@ let programs = {};
22const apiUrl = "https://api2.hackclub.com/v0.1/Unified%20YSWS%20Projects%20DB/YSWS%20Programs?cache=true" ;
33var participants = [ ]
44
5+ async function startRender ( ) {
6+ await Promise . all ( [ loadParticipants ( ) , loadPrograms ( ) ] ) ;
7+ renderPrograms ( ) ;
8+ }
9+ startRender ( )
10+
511function loadParticipants ( ) {
612 fetch ( apiUrl ) . then ( response => {
713 if ( ! response . ok ) {
@@ -74,8 +80,6 @@ async function loadPrograms() {
7480 programs = Object . fromEntries (
7581 Object . entries ( programs ) . filter ( ( [ _ , programsList ] ) => programsList . length > 0 )
7682 ) ;
77-
78- renderPrograms ( ) ;
7983 } catch ( error ) {
8084 console . error ( 'Error loading programs:' , error ) ;
8185 }
@@ -230,7 +234,7 @@ function openModal(program) {
230234 if ( program . participants !== undefined ) {
231235 detailsHTML += `
232236 <h3>Participation</h3>
233- <p>${ formatParticipants ( program . participants ) } </p>
237+ <p>${ formatParticipants ( program . name ) } </p>
234238 ` ;
235239 }
236240
@@ -516,4 +520,4 @@ document.addEventListener('DOMContentLoaded', () => {
516520
517521 document . querySelector ( '.modal-prev' ) . addEventListener ( 'click' , ( ) => navigateModal ( - 1 ) ) ;
518522 document . querySelector ( '.modal-next' ) . addEventListener ( 'click' , ( ) => navigateModal ( 1 ) ) ;
519- } ) ;
523+ } ) ;
You can’t perform that action at this time.
0 commit comments