disable auto refetching of data
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
Lee 2024-09-30 11:23:05 +01:00
parent 7ff29904d9
commit b5071fd420
2 changed files with 0 additions and 5 deletions

@ -13,8 +13,6 @@ import Card from "@/components/card";
import PlayerBadges from "@/components/player/player-badges"; import PlayerBadges from "@/components/player/player-badges";
import { useIsMobile } from "@/hooks/use-is-mobile"; import { useIsMobile } from "@/hooks/use-is-mobile";
const REFRESH_INTERVAL = 5 * 60 * 1000; // 5 minutes
type Props = { type Props = {
initialPlayerData: ScoreSaberPlayer; initialPlayerData: ScoreSaberPlayer;
initialScoreData?: ScoreSaberPlayerScoresPageToken; initialScoreData?: ScoreSaberPlayerScoresPageToken;
@ -36,7 +34,6 @@ export default function PlayerData({
const { data, isLoading, isError } = useQuery({ const { data, isLoading, isError } = useQuery({
queryKey: ["player", player.id], queryKey: ["player", player.id],
queryFn: () => scoresaberService.lookupPlayer(player.id), queryFn: () => scoresaberService.lookupPlayer(player.id),
refetchInterval: REFRESH_INTERVAL,
}); });
if (data && (!isLoading || !isError)) { if (data && (!isLoading || !isError)) {

@ -11,7 +11,6 @@ import { Avatar, AvatarImage } from "../ui/avatar";
import ScoreSaberPlayer from "@/common/model/player/impl/scoresaber-player"; import ScoreSaberPlayer from "@/common/model/player/impl/scoresaber-player";
import { scoresaberService } from "@/common/service/impl/scoresaber"; import { scoresaberService } from "@/common/service/impl/scoresaber";
const REFRESH_INTERVAL = 5 * 60 * 1000; // 5 minutes
const PLAYER_NAME_MAX_LENGTH = 18; const PLAYER_NAME_MAX_LENGTH = 18;
type MiniProps = { type MiniProps = {
@ -91,7 +90,6 @@ export default function Mini({ type, player }: MiniProps) {
return players; return players;
}, },
refetchInterval: REFRESH_INTERVAL,
}); });
let players = data; // So we can update it later let players = data; // So we can update it later