forked from Mirrors/elk
fix: close databases on page freeze event without pwa (#1662)
This commit is contained in:
parent
32cfe6371f
commit
65bbc7c790
1 changed files with 5 additions and 7 deletions
|
@ -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 a new issue