2025-12-17 11:12:10 +00:00
|
|
|
import { createRoot } from "react-dom/client";
|
|
|
|
|
import App from "./App.tsx";
|
|
|
|
|
import "./index.css";
|
|
|
|
|
|
2025-12-17 14:19:57 +00:00
|
|
|
// Registrar Service Worker para PWA
|
|
|
|
|
if ('serviceWorker' in navigator) {
|
|
|
|
|
window.addEventListener('load', () => {
|
|
|
|
|
navigator.serviceWorker
|
|
|
|
|
.register('/sw.js')
|
|
|
|
|
.then((registration) => {
|
|
|
|
|
console.log('SW registered:', registration);
|
|
|
|
|
|
|
|
|
|
// Verificar actualizaciones cada hora
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
registration.update();
|
|
|
|
|
}, 60 * 60 * 1000);
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
console.log('SW registration failed:', error);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-17 11:12:10 +00:00
|
|
|
createRoot(document.getElementById("root")!).render(<App />);
|