Skip to content

Commit

Permalink
Notify PWA update
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 committed Sep 25, 2024
1 parent 4f1340c commit a8ddf32
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions apps/web/src/components/pwa-badge.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { useRegisterSW } from "virtual:pwa-register/react";
import Button from "../ui/button";

const isPWA = window.matchMedia("(display-mode: standalone)").matches;
const enableReload = false;

export default function PWABadge() {
// Periodic sync is disabled, change the value to enable it, the period is in milliseconds
// You can remove onRegisteredSW callback and registerPeriodicSync function
Expand Down Expand Up @@ -32,7 +29,7 @@ export default function PWABadge() {

return (
<div role="alert" aria-labelledby="toast-message">
{needRefresh && isPWA && enableReload && (
{needRefresh && (
<div className="bg-background fixed bottom-0 right-0 z-10 m-4 flex flex-col gap-y-3 rounded-xl border border-white/20 p-3 text-left">
<span id="toast-message" className="text-sm font-bold text-white">
New content available, click on reload button to update.
Expand Down

0 comments on commit a8ddf32

Please sign in to comment.