cleanup
All checks were successful
Deploy Backend / docker (ubuntu-latest) (push) Successful in 46s
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m10s

This commit is contained in:
Lee 2024-10-21 17:39:47 +01:00
parent de47905e28
commit d62b6524f7
4 changed files with 5 additions and 10 deletions

@ -1 +1,4 @@
/**
* The status of the leaderboard.
*/
export type LeaderboardStatus = "Unranked" | "Ranked" | "Qualified"; export type LeaderboardStatus = "Unranked" | "Ranked" | "Qualified";

@ -11,8 +11,6 @@ import { fetchLeaderboard } from "@ssr/common/utils/leaderboard.util";
import LeaderboardScoresResponse from "@ssr/common/response/leaderboard-scores-response"; import LeaderboardScoresResponse from "@ssr/common/response/leaderboard-scores-response";
import LeaderboardPpChart from "@/components/leaderboard/leaderboard-pp-chart"; import LeaderboardPpChart from "@/components/leaderboard/leaderboard-pp-chart";
const REFRESH_INTERVAL = 1000 * 60 * 5;
type LeaderboardDataProps = { type LeaderboardDataProps = {
/** /**
* The initial leaderboard data. * The initial leaderboard data.
@ -39,8 +37,6 @@ export function LeaderboardData({ initialLeaderboard, initialScores, initialPage
queryFn: async (): Promise<LeaderboardResponse<ScoreSaberLeaderboard> | undefined> => { queryFn: async (): Promise<LeaderboardResponse<ScoreSaberLeaderboard> | undefined> => {
return fetchLeaderboard<ScoreSaberLeaderboard>("scoresaber", currentLeaderboardId + ""); return fetchLeaderboard<ScoreSaberLeaderboard>("scoresaber", currentLeaderboardId + "");
}, },
refetchInterval: REFRESH_INTERVAL,
refetchIntervalInBackground: false,
}); });
useEffect(() => { useEffect(() => {

@ -8,8 +8,6 @@ import { useIsMobile } from "@/hooks/use-is-mobile";
import Pagination from "@/components/input/pagination"; import Pagination from "@/components/input/pagination";
import { PlayerRanking } from "@/components/ranking/player-ranking"; import { PlayerRanking } from "@/components/ranking/player-ranking";
const REFRESH_INTERVAL = 1000 * 60 * 5;
type RankingDataProps = { type RankingDataProps = {
initialPage: number; initialPage: number;
country?: string | undefined; country?: string | undefined;
@ -31,8 +29,6 @@ export default function RankingData({ initialPage, country, initialPageData }: R
: await scoresaberService.lookupPlayersByCountry(currentPage, country); : await scoresaberService.lookupPlayersByCountry(currentPage, country);
return players && players.players.length > 0 ? players : undefined; return players && players.players.length > 0 ? players : undefined;
}, },
staleTime: REFRESH_INTERVAL,
refetchInterval: REFRESH_INTERVAL,
refetchIntervalInBackground: false, refetchIntervalInBackground: false,
}); });

@ -26,8 +26,8 @@ export function ScoreModifiers({ score, type }: ScoreModifiersProps) {
return ( return (
<span> <span>
{Object.entries(Modifier) {Object.entries(Modifier)
.filter(mod => modifiers.includes(mod[1] as Modifier)) .filter(([_, mod]) => modifiers.includes(mod))
.map(mod => mod[0]) .map(([mod, _]) => mod)
.join(",")} .join(",")}
</span> </span>
); );