Skip to content

Commit

Permalink
fix: 401 when view scoreboard
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Aug 10, 2022
1 parent 966da58 commit 3202b53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
10 changes: 3 additions & 7 deletions GZCTF/ClientApp/src/components/ScoreboardItemModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import dayjs from 'dayjs'
import { FC } from 'react'
import { useParams } from 'react-router-dom'
import {
Group,
Text,
Expand All @@ -14,11 +13,12 @@ import {
LoadingOverlay,
} from '@mantine/core'
import { useTableStyles } from '@Utils/ThemeOverride'
import api, { ChallengeInfo, ScoreboardItem, SubmissionType } from '@Api'
import { ChallengeInfo, ScoreboardItem, SubmissionType } from '@Api'
import TeamRadarMap from './TeamRadarMap'

interface ScoreboardItemModalProps extends ModalProps {
item?: ScoreboardItem | null
challenges?: Record<string, ChallengeInfo[]>
}

const BloodsMap = new Map([
Expand All @@ -29,11 +29,7 @@ const BloodsMap = new Map([
])

const ScoreboardItemModal: FC<ScoreboardItemModalProps> = (props) => {
const { id } = useParams()
const numId = parseInt(id ?? '-1')
const { item, ...modalProps } = props

const { data: challenges } = api.game.useGameChallenges(numId)
const { item, challenges, ...modalProps } = props
const { classes } = useTableStyles()

const challengeIdMap =
Expand Down
1 change: 1 addition & 0 deletions GZCTF/ClientApp/src/components/ScoreboardTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ const ScoreboardTable: FC = () => {
</Title>
</Group>
}
challenges={scoreboard?.challenges}
opened={itemDetailOpened}
centered
withCloseButton={false}
Expand Down

0 comments on commit 3202b53

Please sign in to comment.