fix: close databases on page freeze event without pwa (#1662)
parent
32cfe6371f
commit
65bbc7c790
|
@ -17,14 +17,12 @@ export default defineNuxtPlugin(() => {
|
||||||
frozenListeners.push(listener)
|
frozenListeners.push(listener)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useAppConfig().pwaEnabled) {
|
addFrozenListener(() => {
|
||||||
addFrozenListener(() => {
|
if (useAppConfig().pwaEnabled && navigator.serviceWorker.controller)
|
||||||
if (navigator.serviceWorker.controller)
|
navigator.serviceWorker.controller.postMessage(ELK_PAGE_LIFECYCLE_FROZEN)
|
||||||
navigator.serviceWorker.controller.postMessage(ELK_PAGE_LIFECYCLE_FROZEN)
|
|
||||||
|
|
||||||
closeDatabases()
|
closeDatabases()
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
provide: {
|
provide: {
|
||||||
|
|
Loading…
Reference in New Issue