fix(frontend): remove PWA service worker to stop demo reloads

Drop vite-plugin-pwa and add an index.html snippet that unregisters any leftover service worker and clears its caches on load. Continuous deploys during the event plus a self-destroying SW were forcing open tabs to reload mid-demo. Browsers self-heal on next load; re-add a precaching PWA post-event.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Kartikeya
2026-06-27 23:15:51 -07:00
parent 1c491866ba
commit e0757088ef
2 changed files with 26 additions and 9 deletions
+21
View File
@@ -30,6 +30,27 @@
content="Ambient AI teammate that catches merge collisions before anyone pushes."
/>
<meta name="twitter:image" content="https://www.podman.live/og.png" />
<script>
// Tear down any service worker we shipped earlier (vite-plugin-pwa).
// PodMan runs no PWA in production: we deploy continuously and SW-driven
// reloads break the live demo. This unregisters leftover workers and
// clears their caches on every load so previously-affected browsers
// self-heal — no manual DevTools needed. It does NOT reload the page and
// is a no-op once nothing is registered.
if ('serviceWorker' in navigator) {
navigator.serviceWorker
.getRegistrations()
.then((regs) => regs.forEach((r) => r.unregister()))
.catch(() => {});
if (window.caches && caches.keys) {
caches
.keys()
.then((keys) => keys.forEach((k) => caches.delete(k)))
.catch(() => {});
}
}
</script>
</head>
<body>
<div id="root"></div>