mirror of
https://github.com/ershisan99/www.git
synced 2025-12-17 12:34:17 +00:00
i'm confused honestly
This commit is contained in:
@@ -21,15 +21,16 @@ export function StreamCardClient() {
|
||||
})
|
||||
const rankedUserRank = rankedUserQuery.data
|
||||
useEffect(() => {
|
||||
setInterval(
|
||||
() => {
|
||||
gamesQuery.refetch()
|
||||
rankedUserQuery.refetch()
|
||||
},
|
||||
// 1 minute
|
||||
1000 * 1 * 30
|
||||
)
|
||||
}, [])
|
||||
const interval = setInterval(async () => {
|
||||
try {
|
||||
await Promise.all([gamesQuery.refetch(), rankedUserQuery.refetch()])
|
||||
} catch (e) {
|
||||
console.error('refetch failed:', e)
|
||||
}
|
||||
}, 1000 * 30)
|
||||
|
||||
return () => clearInterval(interval)
|
||||
}, [gamesQuery, rankedUserQuery])
|
||||
|
||||
if (!rankedUserRank || !games?.length) {
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user