Skip to content

Commit 220169e

Browse files
committed
Fix #22
1 parent 6e64142 commit 220169e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,13 @@ export class BracketsViewer {
119119
* @param matchesByGroup A list of matches for each group.
120120
*/
121121
private renderDoubleElimination(root: HTMLElement, matchesByGroup: Match[][]): void {
122+
const hasLoserBracket = matchesByGroup[1] !== undefined;
122123
const hasFinal = matchesByGroup[2] !== undefined;
124+
123125
this.renderBracket(root, splitBy(matchesByGroup[0], 'round_id'), lang.getWinnerBracketRoundName, false, hasFinal);
124-
this.renderBracket(root, splitBy(matchesByGroup[1], 'round_id'), lang.getLoserBracketRoundName, true);
126+
127+
if (hasLoserBracket)
128+
this.renderBracket(root, splitBy(matchesByGroup[1], 'round_id'), lang.getLoserBracketRoundName, true);
125129

126130
if (hasFinal)
127131
this.renderFinal('grand_final', matchesByGroup[2]);

0 commit comments

Comments
 (0)