mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-22 01:15:25 +03:00
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)
|
||||
}
|
||||
|
||||
if (useAppConfig().pwaEnabled) {
|
||||
addFrozenListener(() => {
|
||||
if (navigator.serviceWorker.controller)
|
||||
navigator.serviceWorker.controller.postMessage(ELK_PAGE_LIFECYCLE_FROZEN)
|
||||
addFrozenListener(() => {
|
||||
if (useAppConfig().pwaEnabled && navigator.serviceWorker.controller)
|
||||
navigator.serviceWorker.controller.postMessage(ELK_PAGE_LIFECYCLE_FROZEN)
|
||||
|
||||
closeDatabases()
|
||||
})
|
||||
}
|
||||
closeDatabases()
|
||||
})
|
||||
|
||||
return {
|
||||
provide: {
|
||||
|
|
Loading…
Reference in a new issue