Skip to content

Commit

Permalink
feat: remove 'offline ready' alert
Browse files Browse the repository at this point in the history
  • Loading branch information
herteleo committed May 31, 2024
1 parent a3f5ac3 commit c56b0c8
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/components/ReloadPrompt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,22 @@
import { useRegisterSW } from 'virtual:pwa-register/vue';
import { displayName } from '@/../package.json';
const { offlineReady, needRefresh, updateServiceWorker } = useRegisterSW();
const { needRefresh, updateServiceWorker } = useRegisterSW();
const close = async () => {
offlineReady.value = false;
needRefresh.value = false;
};
</script>

<template>
<div
v-if="offlineReady || needRefresh"
v-if="needRefresh"
class="fixed right-2 bottom-2 max-w-sm space-y-3 rounded-lg border border-gray-700 bg-gray-800 p-4 text-gray-400 shadow-lg"
role="alert"
>
<div
class="leading-tight"
v-text="
offlineReady
? `${displayName} is now offline available.`
: `A new version of ${displayName} is available.`
"
/>
<div class="leading-tight" v-text="`A new version of ${displayName} is available.`" />
<div class="flex gap-2">
<button
v-if="needRefresh"
class="rounded bg-teal-700 px-2 py-1 font-medium text-teal-200 shadow"
@click="updateServiceWorker()"
>
Expand Down

0 comments on commit c56b0c8

Please sign in to comment.