From d62b6524f775e27a9c7ca3e788f725fa1586ed35 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 21 Oct 2024 17:39:47 +0100 Subject: [PATCH] cleanup --- projects/common/src/leaderboard/leaderboard-status.ts | 3 +++ .../website/src/components/leaderboard/leaderboard-data.tsx | 4 ---- projects/website/src/components/ranking/ranking-data.tsx | 4 ---- projects/website/src/components/score/score-modifiers.tsx | 4 ++-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/projects/common/src/leaderboard/leaderboard-status.ts b/projects/common/src/leaderboard/leaderboard-status.ts index 4934bf9..18e0460 100644 --- a/projects/common/src/leaderboard/leaderboard-status.ts +++ b/projects/common/src/leaderboard/leaderboard-status.ts @@ -1 +1,4 @@ +/** + * The status of the leaderboard. + */ export type LeaderboardStatus = "Unranked" | "Ranked" | "Qualified"; diff --git a/projects/website/src/components/leaderboard/leaderboard-data.tsx b/projects/website/src/components/leaderboard/leaderboard-data.tsx index 7442f64..50aea50 100644 --- a/projects/website/src/components/leaderboard/leaderboard-data.tsx +++ b/projects/website/src/components/leaderboard/leaderboard-data.tsx @@ -11,8 +11,6 @@ import { fetchLeaderboard } from "@ssr/common/utils/leaderboard.util"; import LeaderboardScoresResponse from "@ssr/common/response/leaderboard-scores-response"; import LeaderboardPpChart from "@/components/leaderboard/leaderboard-pp-chart"; -const REFRESH_INTERVAL = 1000 * 60 * 5; - type LeaderboardDataProps = { /** * The initial leaderboard data. @@ -39,8 +37,6 @@ export function LeaderboardData({ initialLeaderboard, initialScores, initialPage queryFn: async (): Promise | undefined> => { return fetchLeaderboard("scoresaber", currentLeaderboardId + ""); }, - refetchInterval: REFRESH_INTERVAL, - refetchIntervalInBackground: false, }); useEffect(() => { diff --git a/projects/website/src/components/ranking/ranking-data.tsx b/projects/website/src/components/ranking/ranking-data.tsx index 28f3ff3..e201209 100644 --- a/projects/website/src/components/ranking/ranking-data.tsx +++ b/projects/website/src/components/ranking/ranking-data.tsx @@ -8,8 +8,6 @@ import { useIsMobile } from "@/hooks/use-is-mobile"; import Pagination from "@/components/input/pagination"; import { PlayerRanking } from "@/components/ranking/player-ranking"; -const REFRESH_INTERVAL = 1000 * 60 * 5; - type RankingDataProps = { initialPage: number; country?: string | undefined; @@ -31,8 +29,6 @@ export default function RankingData({ initialPage, country, initialPageData }: R : await scoresaberService.lookupPlayersByCountry(currentPage, country); return players && players.players.length > 0 ? players : undefined; }, - staleTime: REFRESH_INTERVAL, - refetchInterval: REFRESH_INTERVAL, refetchIntervalInBackground: false, }); diff --git a/projects/website/src/components/score/score-modifiers.tsx b/projects/website/src/components/score/score-modifiers.tsx index f6549f2..9b87d22 100644 --- a/projects/website/src/components/score/score-modifiers.tsx +++ b/projects/website/src/components/score/score-modifiers.tsx @@ -26,8 +26,8 @@ export function ScoreModifiers({ score, type }: ScoreModifiersProps) { return ( {Object.entries(Modifier) - .filter(mod => modifiers.includes(mod[1] as Modifier)) - .map(mod => mod[0]) + .filter(([_, mod]) => modifiers.includes(mod)) + .map(([mod, _]) => mod) .join(",")} );