mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-09 20:30:54 -05:00
Fix already done match showing as current match
This commit is contained in:
parent
7586c352dd
commit
ab266bbcc3
|
|
@ -1,5 +1,6 @@
|
|||
import { useLoaderData, useMatches } from "remix";
|
||||
import invariant from "tiny-invariant";
|
||||
import { matchIsOver } from "~/core/tournament/utils";
|
||||
import type {
|
||||
BracketModified,
|
||||
FindTournamentByNameForUrlI,
|
||||
|
|
@ -52,12 +53,11 @@ export function BracketActions() {
|
|||
);
|
||||
const isOwnMatch = match.participants?.some((p) => p === ownTeam.name);
|
||||
|
||||
const higherCount = match.score
|
||||
? Math.max(match.score[0], match.score[1])
|
||||
: 0;
|
||||
const isNotOver = higherCount < match.round.matches.length / 2;
|
||||
|
||||
return hasBothParticipants && isOwnMatch && isNotOver;
|
||||
return (
|
||||
hasBothParticipants &&
|
||||
isOwnMatch &&
|
||||
!matchIsOver(match.round.stages.length, match.score)
|
||||
);
|
||||
});
|
||||
|
||||
if (currentMatch) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user