@@ -456,16 +366,6 @@ function AutoRefresher() {
return null;
}
-function appendStyleTagToHead(content: string) {
- const head = document.head || document.getElementsByTagName("head")[0];
- const style = document.createElement("style");
-
- head.appendChild(style);
-
- style.type = "text/css";
- style.appendChild(document.createTextNode(content));
-}
-
function useAutoRefresh() {
const { revalidate } = useRevalidator();
const tournament = useTournament();
@@ -479,31 +379,8 @@ function useAutoRefresh() {
React.useEffect(() => {
if (!lastEvent) return;
- const [matchIdRaw, scoreOneRaw, scoreTwoRaw, isOverRaw] =
- lastEvent.split("-");
- const matchId = Number(matchIdRaw);
- const scoreOne = Number(scoreOneRaw);
- const scoreTwo = Number(scoreTwoRaw);
- const isOver = isOverRaw === "true";
-
- if (isOver) {
- // bracketsViewer.updateMatch can't advance bracket
- // so we revalidate loader when the match is over
- revalidate();
- } else {
- // TODO: shows 1 - "-" when updating match where other score is 0
- // @ts-expect-error - brackets-viewer is not typed
- window.bracketsViewer.updateMatch({
- id: matchId,
- opponent1: {
- score: scoreOne,
- },
- opponent2: {
- score: scoreTwo,
- },
- status: Status.Running,
- });
- }
+ // TODO: maybe later could look into not revalidating unless bracket advanced but do something fancy in the tournament class instead
+ revalidate();
}, [lastEvent, revalidate]);
}
@@ -538,7 +415,7 @@ function AddSubsPopOver() {
tournament.maxTeamMemberCount - ownedTeam.members.length;
const inviteLink = `${SENDOU_INK_BASE_URL}${tournamentJoinPage({
- eventId: tournament.ctx.id,
+ tournamentId: tournament.ctx.id,
inviteCode: ownedTeam.inviteCode,
})}`;
@@ -571,12 +448,16 @@ function AddSubsPopOver() {
);
}
+const MAX_PLACEMENT_TO_SHOW = 7;
+
function FinalStandings() {
const tournament = useTournament();
const { t } = useTranslation(["tournament"]);
const [viewAll, setViewAll] = React.useState(false);
- const standings = tournament.standings;
+ const standings = tournament.standings.filter(
+ (s) => s.placement <= MAX_PLACEMENT_TO_SHOW,
+ );
if (standings.length < 2) {
console.error("Unexpectedly few standings");
@@ -613,7 +494,7 @@ function FinalStandings() {
+
{tournament.ctx.settings.bracketProgression.map((bracket, i) => {
// underground bracket was never played despite being in the format
if (
@@ -762,17 +643,32 @@ function BracketNav({
return (
);
})}