Skip to content

Commit

Permalink
Hide PWA reload
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 committed Sep 12, 2024
1 parent 8788684 commit 45b864c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/web/src/components/pwa-badge.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
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 @@ -29,7 +32,7 @@ export default function PWABadge() {

return (
<div role="alert" aria-labelledby="toast-message">
{needRefresh && (
{needRefresh && isPWA && enableReload && (
<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 45b864c

Please sign in to comment.