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(() => {
|
||||
if (document.visibilityState === 'visible') refetch()
|
||||
}, POLL_INTERVAL_MS)
|
||||
|
|
|
|||
Loading…
Reference in a new issue