fix: handle frozen page lifecycle state (#1658)

This commit is contained in:
Joaquín Sánchez 2023-02-06 23:22:56 +01:00 committed by GitHub
parent f7a8d471a6
commit 32cfe6371f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 134 additions and 3 deletions

View file

@ -106,6 +106,9 @@ export function useStreaming(
stream.value = cb(client.value)
})
if (process.client && !process.test)
useNuxtApp().$pageLifecycle.addFrozenListener(cleanup)
tryOnBeforeUnmount(() => isActive.value = false)
if (controls)