mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-11 12:32:55 +00:00
24 lines
611 B
Svelte
24 lines
611 B
Svelte
<script>
|
|
// @ts-expect-error no types here
|
|
import { useRegisterSW } from "virtual:pwa-register/svelte";
|
|
|
|
const { needRefresh, updateServiceWorker, offlineReady } = useRegisterSW();
|
|
</script>
|
|
|
|
{#if $needRefresh}
|
|
<button title="Update ready" onclick={() => updateServiceWorker(true)}
|
|
>Update <span class="icon">update</span></button
|
|
>
|
|
{:else if $offlineReady}
|
|
<div title="App can now be used offline" class="icon">offline_pin</div>
|
|
{/if}
|
|
|
|
<style lang="scss">
|
|
button {
|
|
cursor: pointer;
|
|
color: var(--md-sys-color-on-background);
|
|
background: transparent;
|
|
border: none;
|
|
}
|
|
</style>
|