Skip to content

Commit

Permalink
refactor(layout): Use immediate option
Browse files Browse the repository at this point in the history
It's much simpler and clean.
  • Loading branch information
5ouma committed Nov 16, 2024
1 parent 72e2bea commit 5467469
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,5 @@ const { title, description, icon } = Astro.props;

<script>
import { registerSW } from "virtual:pwa-register";
if ("serviceWorker" in navigator) {
const updateSW = registerSW({
onNeedRefresh() {
updateSW(true);
},
});
}
if ("serviceWorker" in navigator) registerSW({ immediate: true });
</script>

0 comments on commit 5467469

Please sign in to comment.