This commit is contained in:
parent
603f991bb7
commit
bef977be5c
1 changed files with 16 additions and 0 deletions
|
@ -1,7 +1,23 @@
|
||||||
<script>
|
<script>
|
||||||
import { pwaInfo } from 'virtual:pwa-info';
|
import { pwaInfo } from 'virtual:pwa-info';
|
||||||
|
import { onMount } from 'svelte'
|
||||||
import BottomAppBar from '$lib/components/BottomAppBar.svelte';
|
import BottomAppBar from '$lib/components/BottomAppBar.svelte';
|
||||||
$: webManifestLink = pwaInfo ? pwaInfo.webManifest.linkTag : ''
|
$: webManifestLink = pwaInfo ? pwaInfo.webManifest.linkTag : ''
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
if (pwaInfo) {
|
||||||
|
const { registerSW } = await import('virtual:pwa-register')
|
||||||
|
registerSW({
|
||||||
|
immediate: true,
|
||||||
|
onRegistered(r) {
|
||||||
|
console.log(`SW Registered: ${r}`)
|
||||||
|
},
|
||||||
|
onRegisterError(error) {
|
||||||
|
console.log('SW registration error', error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
|
Loading…
Reference in a new issue