Skip to content

Commit 5279c02

Browse files
committed
Fix demo for single elimination
1 parent 4c9c685 commit 5279c02

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

demo/with-api.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,15 @@
4747
// You have a reference to `t` in order to translate things.
4848
// Returning `undefined` will fallback to the default round name in the current language.
4949

50-
if (info.fractionOfFinal === 1 / 2)
51-
return `${t(`abbreviations.${info.groupType}`)} Semi Finals`
50+
if (info.fractionOfFinal === 1 / 2) {
51+
if (info.groupType === 'single-bracket') {
52+
// Single elimination
53+
return 'Semi Finals'
54+
} else {
55+
// Double elimination
56+
return `${t(`abbreviations.${info.groupType}`)} Semi Finals`
57+
}
58+
}
5259

5360
if (info.finalType === 'grand-final') {
5461
if (info.roundCount > 1) {
@@ -71,4 +78,4 @@
7178
</script>
7279
</body>
7380

74-
</html>
81+
</html>

demo/with-local-storage.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,15 @@
5656
// You have a reference to `t` in order to translate things.
5757
// Returning `undefined` will fallback to the default round name in the current language.
5858

59-
if (info.fractionOfFinal === 1 / 2)
60-
return `${t(`abbreviations.${info.groupType}`)} Semi Finals`
59+
if (info.fractionOfFinal === 1 / 2) {
60+
if (info.groupType === 'single-bracket') {
61+
// Single elimination
62+
return 'Semi Finals'
63+
} else {
64+
// Double elimination
65+
return `${t(`abbreviations.${info.groupType}`)} Semi Finals`
66+
}
67+
}
6168

6269
if (info.finalType === 'grand-final') {
6370
if (info.roundCount > 1) {
@@ -80,4 +87,4 @@
8087
</script>
8188
</body>
8289

83-
</html>
90+
</html>

0 commit comments

Comments
 (0)