From cec3541345340d3b7ad1b80d5fc2a9eda476e77f Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 19 Oct 2024 11:31:53 +0100 Subject: [PATCH] refresh interval on scores --- projects/website/src/components/player/player-scores.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/website/src/components/player/player-scores.tsx b/projects/website/src/components/player/player-scores.tsx index 0dcf3f3..d3d8292 100644 --- a/projects/website/src/components/player/player-scores.tsx +++ b/projects/website/src/components/player/player-scores.tsx @@ -20,6 +20,8 @@ import ScoreSaberLeaderboard from "@ssr/common/leaderboard/impl/scoresaber-leade import { fetchPlayerScores } from "@ssr/common/utils/score-utils"; import PlayerScoresResponse from "@ssr/common/response/player-scores-response"; +const REFRESH_INTERVAL = 1000 * 60 * 5; + type Props = { initialScoreData?: PlayerScoresResponse; initialSearch?: string; @@ -71,7 +73,8 @@ export default function PlayerScores({ initialScoreData, initialSearch, player, pageState.sort, debouncedSearchTerm ), - staleTime: 30 * 1000, // 30 seconds + refetchInterval: REFRESH_INTERVAL, + refetchIntervalInBackground: false, enabled: shouldFetch && (debouncedSearchTerm.length >= 3 || debouncedSearchTerm.length === 0), });