Skip to content

Commit

Permalink
fix: minecraft refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Apr 22, 2024
1 parent 0f0b49d commit 2e4042e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/components/Plugins/Minecraft/Minecraft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ export function Minecraft() {
} as McData)

useEffect(() => {
(async () => {
const intv = setInterval(async () => {
const data = await fetch('/api/minecraft').then((res) => res.json())
setData(data)
})()
}, 5000)

return () => clearInterval(intv)
}, [])

return (
Expand Down

0 comments on commit 2e4042e

Please sign in to comment.