diff --git a/server/shell.ts b/server/shell.ts index 8511adf7..94fa1e09 100644 --- a/server/shell.ts +++ b/server/shell.ts @@ -398,14 +398,17 @@ export function renderShell(opts: ShellOptions): string { } // Install banner — browser only (not shown in installed PWA) - // Permanently dismissed once closed or installed (localStorage key persists) + // Permanently dismissed once closed or installed. + // Uses root-domain cookie so dismissal persists across all subdomains. if (!isStandalone) { - const installDismissed = () => localStorage.getItem('rspace_install_dismissed') === '1'; + const installDismissed = () => document.cookie.includes('rspace_install_dismissed=1'); const dismissInstall = () => { const b = document.getElementById('pwa-install-banner'); if (b) b.style.display = 'none'; document.body.classList.remove('rspace-banner-visible'); - localStorage.setItem('rspace_install_dismissed', '1'); + const host = location.hostname; + const domainPart = host.includes('.') ? '; domain=.' + host.split('.').slice(-2).join('.') : ''; + document.cookie = 'rspace_install_dismissed=1; path=/; max-age=315360000; SameSite=Lax' + domainPart; }; window.addEventListener("beforeinstallprompt", (e) => {