add auto refresh
All checks were successful
Publish / deploy (push) Successful in 43s

This commit is contained in:
Lee 2023-11-21 14:26:47 +00:00
parent e3b37358b9
commit 80eb7a17fe

@ -34,6 +34,7 @@ export default function Home() {
) )
.then((res) => res.json()) .then((res) => res.json())
.then((res) => res.players.find((player: any) => player.rank === rank)); .then((res) => res.players.find((player: any) => player.rank === rank));
console.log(playerAtRank);
if (!playerAtRank) { if (!playerAtRank) {
console.log("Player not found"); console.log("Player not found");
@ -49,6 +50,7 @@ export default function Home() {
setMounted(true); setMounted(true);
updateRank(); updateRank();
setInterval(updateRank, 1000 * 60 * 1); // update every minute
}, [mounted, updateRank]); }, [mounted, updateRank]);
return ( return (