From b0f491401f9a2de71f2eb64da17d83cf5bbdbff4 Mon Sep 17 00:00:00 2001 From: Maxim Date: Tue, 16 Apr 2024 14:28:05 +0200 Subject: [PATCH] Revert "Fix for scoreboard" This reverts commit 401630d8651cd4c1de391862bd5233016bcafa27. --- .../overlay/src/components/molecules/info/ContestantInfo.tsx | 2 +- src/frontend/overlay/src/components/organisms/widgets/Queue.tsx | 2 +- .../overlay/src/components/organisms/widgets/Scoreboard.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/overlay/src/components/molecules/info/ContestantInfo.tsx b/src/frontend/overlay/src/components/molecules/info/ContestantInfo.tsx index c398fd30f..113f3c54b 100644 --- a/src/frontend/overlay/src/components/molecules/info/ContestantInfo.tsx +++ b/src/frontend/overlay/src/components/molecules/info/ContestantInfo.tsx @@ -50,7 +50,7 @@ export const ContestantInfo = ({ teamId, roundBR= true, className = null }) => { const contestInfo = useAppSelector((state) => state.contestInfo.info); const scoreboardData = useAppSelector((state) => state.scoreboard[SCOREBOARD_TYPES.normal].ids[teamId]); const awards = useAppSelector((state) => state.scoreboard[SCOREBOARD_TYPES.normal].idAwards[teamId]); - const rank = useAppSelector((state) => teamId in state.scoreboard[SCOREBOARD_TYPES.normal].rankById && state.scoreboard[SCOREBOARD_TYPES.normal].rankById[teamId]); + const rank = useAppSelector((state) => state.scoreboard[SCOREBOARD_TYPES.normal].rankById[teamId]); const medal = awards?.find((award) => award.type == Award.Type.medal) as Award.medal; const teamData = useAppSelector((state) => state.contestInfo.info?.teamsId[teamId]); const formatPenalty = useFormatPenalty(); diff --git a/src/frontend/overlay/src/components/organisms/widgets/Queue.tsx b/src/frontend/overlay/src/components/organisms/widgets/Queue.tsx index 592cadb64..127ff5042 100644 --- a/src/frontend/overlay/src/components/organisms/widgets/Queue.tsx +++ b/src/frontend/overlay/src/components/organisms/widgets/Queue.tsx @@ -298,7 +298,7 @@ export const QueueRow = ({ runInfo, const teamData = useAppSelector((state) => state.contestInfo.info?.teamsId[runInfo.teamId]); const probData = useAppSelector((state) => state.contestInfo.info?.problemsId[runInfo.problemId]); const awards = useAppSelector((state) => state.scoreboard[SCOREBOARD_TYPES.normal].idAwards[runInfo.teamId]); - const rank = useAppSelector((state) => runInfo.teamId in state.scoreboard[SCOREBOARD_TYPES.normal].rankById && state.scoreboard[SCOREBOARD_TYPES.normal].rankById[runInfo.teamId]); + const rank = useAppSelector((state) => state.scoreboard[SCOREBOARD_TYPES.normal].rankById[runInfo.teamId]); const medal = awards?.find((award) => award.type == Award.Type.medal) as Award.medal; const isFTSRun = runInfo?.result?.type === "ICPC" && runInfo.result.isFirstToSolveRun || runInfo?.result?.type === "IOI" && runInfo.result.isFirstBestRun; return state.contestInfo.info); const teamData = useAppSelector((state) => state.contestInfo.info?.teamsId[teamId]); const awards: Award[] = useAppSelector((state) => state.scoreboard[SCOREBOARD_TYPES.normal].idAwards[teamId]); - const rank = useAppSelector((state) => teamId in state.scoreboard[SCOREBOARD_TYPES.normal].rankById && state.scoreboard[SCOREBOARD_TYPES.normal].rankById[teamId]); + const rank = useAppSelector((state) => state.scoreboard[SCOREBOARD_TYPES.normal].rankById[teamId]); const medal = awards?.find((award) => award.type == Award.Type.medal) as Award.medal; const needPenalty = useNeedPenalty(); const formatPenalty = useFormatPenalty();