diff options
author | Matt Strapp <matt@mattstrapp.net> | 2023-09-29 10:11:33 -0500 |
---|---|---|
committer | Matt Strapp <matt@mattstrapp.net> | 2023-09-29 10:11:33 -0500 |
commit | 11ece69e006b446b9ca4e06eb5af5662bc811469 (patch) | |
tree | 29dbb0b4b88aa9eae29d80f5ebc08b8f710f51f8 /app/src/lib/svelte/ReloadPrompt.svelte | |
parent | Update dep + fix build (diff) | |
download | trinkets-11ece69e006b446b9ca4e06eb5af5662bc811469.tar trinkets-11ece69e006b446b9ca4e06eb5af5662bc811469.tar.gz trinkets-11ece69e006b446b9ca4e06eb5af5662bc811469.tar.bz2 trinkets-11ece69e006b446b9ca4e06eb5af5662bc811469.tar.lz trinkets-11ece69e006b446b9ca4e06eb5af5662bc811469.tar.xz trinkets-11ece69e006b446b9ca4e06eb5af5662bc811469.tar.zst trinkets-11ece69e006b446b9ca4e06eb5af5662bc811469.zip |
Formatting
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to 'app/src/lib/svelte/ReloadPrompt.svelte')
-rw-r--r-- | app/src/lib/svelte/ReloadPrompt.svelte | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/app/src/lib/svelte/ReloadPrompt.svelte b/app/src/lib/svelte/ReloadPrompt.svelte index d54a202..e6effbb 100644 --- a/app/src/lib/svelte/ReloadPrompt.svelte +++ b/app/src/lib/svelte/ReloadPrompt.svelte @@ -1,34 +1,32 @@ <script lang="ts"> - import { getToastStore } from "@skeletonlabs/skeleton"; - import { useRegisterSW } from "virtual:pwa-register/svelte"; + import { getToastStore } from '@skeletonlabs/skeleton' + import { useRegisterSW } from 'virtual:pwa-register/svelte' - const toastStore = getToastStore(); + const toastStore = getToastStore() - const { - updateServiceWorker, - } = useRegisterSW({ - onRegisteredSW(r) { - console.log("SW Registered: ", r) - }, - onNeedRefresh() { - toastStore.trigger({ - message: 'A new version of the application is available.', - autohide: false, - action: { - label: 'Refresh', - response: updateServiceWorker - } - }); - }, - onOfflineReady() { - toastStore.trigger({ - background: 'variant-filled-success', - message: 'Now ready for offline use!', - timeout: 5000 - }); - }, - onRegisterError(err) { - console.error("SW Registration Error: ", err) - } - }) -</script>
\ No newline at end of file + const { updateServiceWorker } = useRegisterSW({ + onRegisteredSW(r) { + console.log('SW Registered: ', r) + }, + onNeedRefresh() { + toastStore.trigger({ + message: 'A new version of the application is available.', + autohide: false, + action: { + label: 'Refresh', + response: updateServiceWorker, + }, + }) + }, + onOfflineReady() { + toastStore.trigger({ + background: 'variant-filled-success', + message: 'Now ready for offline use!', + timeout: 5000, + }) + }, + onRegisterError(err) { + console.error('SW Registration Error: ', err) + }, + }) +</script> |