refresh interval on scores
All checks were successful
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m11s
All checks were successful
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m11s
This commit is contained in:
parent
ac6aaee208
commit
cec3541345
@ -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<ScoreSaberScore, ScoreSaberLeaderboard>;
|
||||
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),
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user