@@ -165,17 +165,16 @@ export class BracketsViewer {
165
165
const upperBracket = document . querySelector ( '.bracket' ) ;
166
166
if ( ! upperBracket ) throw Error ( 'Upper bracket not found.' ) ;
167
167
168
- const grandFinalName = lang . getGrandFinalName ( matches . length ) ;
169
-
170
168
const winnerWb = matches [ 0 ] . opponent1 ;
171
169
const finalsToDisplay = ( winnerWb && winnerWb . id != null && winnerWb . result != "win" ) ? 2 : 1 ;
172
-
173
170
const finalMatches = matches . slice ( 0 , finalsToDisplay ) ;
174
171
172
+ const roundCount = matches . length ;
173
+
175
174
for ( let i = 0 ; i < finalMatches . length ; i ++ ) {
176
175
const roundNumber = i + 1 ;
177
- const roundContainer = dom . createRoundContainer ( lang . getFinalMatchLabel ( finalType , grandFinalName , roundNumber ) ) ;
178
- roundContainer . append ( this . createFinalMatch ( finalType , grandFinalName , finalMatches , roundNumber ) ) ;
176
+ const roundContainer = dom . createRoundContainer ( lang . getFinalMatchLabel ( finalType , roundNumber , roundCount ) ) ;
177
+ roundContainer . append ( this . createFinalMatch ( finalType , finalMatches , roundNumber , roundCount ) ) ;
179
178
upperBracket . append ( roundContainer ) ;
180
179
}
181
180
}
@@ -245,14 +244,14 @@ export class BracketsViewer {
245
244
* Creates a match in a final.
246
245
*
247
246
* @param type Type of the final.
248
- * @param grandFinalName A function giving a grand final phase's name based on the round number.
249
247
* @param matches Matches of the final.
250
248
* @param roundNumber Number of the round.
249
+ * @param roundCount Count of rounds.
251
250
*/
252
- private createFinalMatch ( type : FinalType , grandFinalName : ( roundNumber : number ) => string , matches : Match [ ] , roundNumber : number ) : HTMLElement {
251
+ private createFinalMatch ( type : FinalType , matches : Match [ ] , roundNumber : number , roundCount : number ) : HTMLElement {
253
252
const roundIndex = roundNumber - 1 ;
254
253
const connection = dom . getFinalConnection ( type , roundNumber , matches . length ) ;
255
- const matchLabel = lang . getFinalMatchLabel ( type , grandFinalName , roundNumber ) ;
254
+ const matchLabel = lang . getFinalMatchLabel ( type , roundNumber , roundCount ) ;
256
255
const matchHint = lang . getFinalMatchHint ( type , roundNumber ) ;
257
256
return this . createMatch ( matches [ roundIndex ] , connection , matchLabel , matchHint ) ;
258
257
}
@@ -319,6 +318,7 @@ export class BracketsViewer {
319
318
/**
320
319
* Renders a participant.
321
320
*
321
+ * @param teamContainer The team container.
322
322
* @param nameContainer The name container.
323
323
* @param resultContainer The result container.
324
324
* @param team The participant result.
0 commit comments