Skip to content

Commit

Permalink
feat: When no bracket key or bracket key 'match' take match bracket (#…
Browse files Browse the repository at this point in the history
…211)

* feat: When no bracket key or bracket key 'match' take match bracket

* chore: Optional chaining

* Minor fixes to logic

---------

Co-authored-by: Solomon Cammack <[email protected]>
  • Loading branch information
MrLotU and slmnio authored Sep 3, 2023
1 parent 30d1285 commit 7cd8d56
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion website/src/components/broadcast/roots/BracketOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export default {
if (this.broadcast?.bracket_key) key = this.broadcast.bracket_key;
if (this.bracketKey) key = this.bracketKey;
if (this.liveMatch && (!key || key === "match")) {
key = this.liveMatch.brackets?.[0]?.key;
}
if (!key) return this.event.brackets[0];
const bracket = this.event.brackets.find(b => b && b.key === key);
return bracket || this.event.brackets[0];
Expand All @@ -52,7 +56,8 @@ export default {
liveMatch() {
if (!this.broadcast?.live_match) return null;
return ReactiveRoot(this.broadcast.live_match[0], {
teams: ReactiveArray("teams")
teams: ReactiveArray("teams"),
brackets: ReactiveArray("brackets")
});
},
highlightMatch() {
Expand Down

0 comments on commit 7cd8d56

Please sign in to comment.