Manual registrations for worker

This commit is contained in:
Sidharth Vinod
2021-05-31 16:52:44 +05:30
parent 9c20831d61
commit efb42aa005
3 changed files with 11 additions and 1 deletions
+9
View File
@@ -1,5 +1,14 @@
<script lang="ts">
import '../app.postcss';
import { base } from '$app/paths';
import { onMount } from 'svelte';
// This can be removed once https://github.com/sveltejs/kit/issues/1612 is fixed.
// Then move it into src and vite will bundle it automatically.
onMount(() => {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register(`${base}/service-worker.js`);
}
});
</script>
<main class="h-screen">
+2 -1
View File
@@ -21,7 +21,8 @@ export const get = (): { body: unknown } => {
display: 'standalone',
scope: `${base}`,
theme_color: '#6366F1',
description: 'Description'
description: 'FlowChart & Diagrams Editor.',
orientation: 'landscape'
}
};
};