mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-23 16:13:04 +00:00
Fetch live count on mount to override stale initialCount
This commit is contained in:
parent
260f75abe8
commit
166104bbac
1 changed files with 4 additions and 0 deletions
|
|
@ -73,6 +73,10 @@ export const SignatureCounter = ({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Busca o valor real imediatamente ao montar,
|
||||||
|
// pois o initialCount pode estar defasado (página gerada estaticamente).
|
||||||
|
refetch()
|
||||||
|
|
||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
if (document.visibilityState === 'visible') refetch()
|
if (document.visibilityState === 'visible') refetch()
|
||||||
}, POLL_INTERVAL_MS)
|
}, POLL_INTERVAL_MS)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue