From f35d2cd80ca8fb475df2974283361f17c487d11f Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 13 Jun 2026 15:21:54 +0300 Subject: [PATCH] Remember if 'Add to homescreen' dismissed --- src/components/InstallPWA.astro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/InstallPWA.astro b/src/components/InstallPWA.astro index c81b21141..76c706292 100644 --- a/src/components/InstallPWA.astro +++ b/src/components/InstallPWA.astro @@ -59,6 +59,7 @@ installBtn.addEventListener('click', () => { }); closeBtn.addEventListener('click', () => { + localStorage.setItem('install-pwa-dismissed', 'true'); hideInstallPrompt(); }); @@ -66,6 +67,8 @@ let deferredPrompt: any; window.addEventListener('beforeinstallprompt', (e) => { e.preventDefault(); deferredPrompt = e; - showInstallPrompt(); + if (localStorage.getItem('install-pwa-dismissed') !== 'true') { + showInstallPrompt(); + } });