Skip to content

Commit

Permalink
feat(pwa): notify user when app is offline ready
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-berlin committed Feb 18, 2024
1 parent c655520 commit 41610b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/services/pwa.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { registerSW } from "virtual:pwa-register";
import { createToastNotify } from "@stores/index.ts";

registerSW({
immediate: true,
Expand All @@ -7,5 +8,12 @@ registerSW({
},
onOfflineReady() {
console.log("PWA application ready to work offline");

createToastNotify({
message: "Berliner Schnauze kann jetzt offline genutzt werden.",
status: "success",
timeout: null,
showClose: true,
});
},
});

0 comments on commit 41610b9

Please sign in to comment.