From f6b4af7f04c4dabcf9c8551f2d5459a58ac0384d Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Thu, 28 Jul 2022 19:50:18 +0200 Subject: [PATCH] Fix: comps starting at 1/2 final --- src/data/SpeedFlowchart.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data/SpeedFlowchart.tsx b/src/data/SpeedFlowchart.tsx index be352f4..63677f3 100644 --- a/src/data/SpeedFlowchart.tsx +++ b/src/data/SpeedFlowchart.tsx @@ -212,11 +212,12 @@ 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], [1, 8, 4, 5, 2, 7, 3, 6], - ][firstRoundRank / 4]; + ][Math.floor(firstRoundRank / 4)]; const firstRoundPairs = ranksOfLaneAInOrder.map(rank => { return {