diff --git a/src/data/SpeedFlowchart.tsx b/src/data/SpeedFlowchart.tsx index 63677f3..da0ac14 100644 --- a/src/data/SpeedFlowchart.tsx +++ b/src/data/SpeedFlowchart.tsx @@ -75,8 +75,6 @@ function computeWinnerOfPair(pair: SpeedRoundPair, roundIndex: number) { ) return; - console.log('Conputing winner of round ', roundIndex); - pair.laneA.result = pair.laneA.participant.results[roundIndex]; pair.laneB.result = pair.laneB.participant.results[roundIndex]; @@ -212,7 +210,6 @@ export function convertResultsToSpeedFlowchartResult( // - 1, 4, 2, 3 for firstRoundNumber=4 // - 1, 2 for firstRoundNumber=2 // TODO: come up with a proper alogorithm maybe - console.log('First round rank: ', firstRoundRank); const ranksOfLaneAInOrder = [ [1, 2], [1, 4, 2, 3], @@ -234,12 +231,9 @@ export function convertResultsToSpeedFlowchartResult( rounds.push(firstRound); - console.log(firstRound); - // compute following rounds let roundIndex = roundIndices[1]; for (let roundRank = firstRoundRank; roundRank > 2; roundRank /= 2) { - console.log('Processing rank', roundRank); rounds.push( computeRoundFromPreviousRound( roundIndex, diff --git a/src/pages/CalendarPage.tsx b/src/pages/CalendarPage.tsx index 2250ca8..dbc5daf 100644 --- a/src/pages/CalendarPage.tsx +++ b/src/pages/CalendarPage.tsx @@ -33,7 +33,6 @@ export default function CalendarPage() { React.useEffect(() => { api.getCompetitions('GER').then(result => { - console.log(result.competitions.filter); competitions.current = result.competitions.filter(competition => competition.discipline?.includes('speed'), ); diff --git a/src/pages/SpeedFlowchartPage.tsx b/src/pages/SpeedFlowchartPage.tsx index 697a26c..9de3f5d 100644 --- a/src/pages/SpeedFlowchartPage.tsx +++ b/src/pages/SpeedFlowchartPage.tsx @@ -26,12 +26,22 @@ export default function SpeedFlowchartPage() { useState(); useEffect(() => { - if (competitionId === undefined || categoryId === undefined) { - return; - } setTitle(''); setContainerMaxWidth(false); + loadData(); + + const interval = setInterval(loadData, 2000); + + return () => clearInterval(interval); + }, []); + + const loadData = () => { + if (competitionId === undefined || categoryId === undefined) { + setLoading(false); + return; + } + api.getCompetitionResults(competitionId, categoryId).then(r => { setTitle( `${r.comp_name} - ${ @@ -40,7 +50,6 @@ export default function SpeedFlowchartPage() { ); setLoading(false); - console.log('loading false'); const flowchartResult = convertResultsToSpeedFlowchartResult(r); const l = flowchartResult.rounds.length; @@ -56,7 +65,7 @@ export default function SpeedFlowchartPage() { flowchartResult.rounds.pop(); setFlowchartResult(flowchartResult); }); - }, []); + }; return ( <>