fix(camera-parity-pwa): resolver parpadeo de camara, paridad funcional de acompanantes, lotes, egreso y PWA responsive

This commit is contained in:
Carlos Tello
2026-10-14 07:46:25 -03:00
parent dc8fb54983
commit cfb24d81c4
14 changed files with 1816 additions and 63 deletions
+59
View File
@@ -0,0 +1,59 @@
// ==============================================================================
// Service Worker para OnEverControl PWA
// Permite instalación en Android / Windows y aceleración de carga en red local
// ==============================================================================
const CACHE_NAME = 'onevercontrol-v0.6.2';
const STATIC_ASSETS = [
'/',
'/index.html',
'/manifest.json',
'/favicon.ico',
'/logo_mini.png',
'/logo_os.png',
'/icons/puesto-control.ico',
'/icons/identificaciones.ico',
'/icons/movimientos.ico'
];
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE_NAME).then((cache) => {
return cache.addAll(STATIC_ASSETS).catch(() => {});
})
);
self.skipWaiting();
});
self.addEventListener('activate', (event) => {
event.waitUntil(
caches.keys().then((keys) => {
return Promise.all(
keys.filter((key) => key !== CACHE_NAME).map((key) => caches.delete(key))
);
})
);
self.clients.claim();
});
self.addEventListener('fetch', (event) => {
const url = new URL(event.request.url);
// No interceptar peticiones a la API backend ni WebSockets
if (url.pathname.startsWith('/api') || url.pathname.startsWith('/ws')) {
return;
}
event.respondWith(
caches.match(event.request).then((cachedResponse) => {
if (cachedResponse) {
return cachedResponse;
}
return fetch(event.request).catch(() => {
// Fallback a index.html en navegación SPA
if (event.request.mode === 'navigate') {
return caches.match('/');
}
});
})
);
});