Major update for v1 and tests

This commit is contained in:
khalid@traclabs.com
2026-05-23 03:28:58 -05:00
parent 628a6765f4
commit b1fb6fa3aa
1748 changed files with 27723 additions and 1854 deletions

View File

@@ -3,20 +3,11 @@ import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App'
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.ready.then((registration) => {
registration.addEventListener('updatefound', () => {
const newWorker = registration.installing;
newWorker.addEventListener('statechange', () => {
if (newWorker.state === 'installed' && navigator.serviceWorker.controller) {
window.dispatchEvent(new CustomEvent('swUpdated', { detail: newWorker }));
}
});
});
});
});
}
// Service worker registration is handled inside <PWAInstall /> via the
// `useRegisterSW` hook from `virtual:pwa-register/react`. We removed the
// hand-rolled `navigator.serviceWorker.ready` listener that used to live here
// because (a) it didn't actually register the SW — it just listened for updates
// — and (b) it duplicated state the plugin already exposes via the hook.
createRoot(document.getElementById('root')).render(
<StrictMode>