fix(nuxt): reset cookie timeoutLength after expiration (#27632)

This commit is contained in:
Leo Osa 2024-06-15 14:24:15 +03:00 committed by GitHub
parent ae5806518a
commit a3d8f005a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -198,6 +198,7 @@ function cookieRef<T> (value: T | undefined, delay: number, shouldWatch: boolean
if (shouldWatch) { unsubscribe = watch(internalRef, trigger) }
function createExpirationTimeout () {
elapsed = 0
clearTimeout(timeout)
const timeRemaining = delay - elapsed
const timeoutLength = timeRemaining < MAX_TIMEOUT_DELAY ? timeRemaining : MAX_TIMEOUT_DELAY