mirror of
https://github.com/andatoshiki/toshiki-notebook.git
synced 2026-06-06 03:11:22 +00:00
feat: add enhance application features and unregistered pwa service
This commit is contained in:
parent
785f9e373d
commit
fec13a59f4
@ -19,6 +19,28 @@ import AsideSponsors from './components/AsideSponsors.vue'
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Copyright from './components/Copyright.vue'
|
import Copyright from './components/Copyright.vue'
|
||||||
|
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
// unregister PWA service
|
||||||
|
if (window.navigator && navigator.serviceWorker) {
|
||||||
|
navigator.serviceWorker.getRegistrations().then(function (registrations) {
|
||||||
|
for (let registration of registrations) {
|
||||||
|
registration.unregister()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// delete the cache preserved in browser
|
||||||
|
if ('caches' in window) {
|
||||||
|
caches.keys().then(function (keyList) {
|
||||||
|
return Promise.all(
|
||||||
|
keyList.map(function (key) {
|
||||||
|
return caches.delete(key)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...DefaultTheme,
|
...DefaultTheme,
|
||||||
Layout: () => {
|
Layout: () => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user