fix(pos): corregir recorte de pestañas en terminal móvil y añadir notificaciones push y en-app para recargas SINPE

This commit is contained in:
unknown
2026-10-06 01:03:54 -06:00
parent e15c801dd5
commit 7217cefa0f
5 changed files with 541 additions and 36 deletions
+20
View File
@@ -75,3 +75,23 @@ self.addEventListener('fetch', (event) => {
})
);
});
// Manejador de clics en Notificaciones Push
self.addEventListener('notificationclick', (event) => {
event.notification.close();
const urlToOpen = (event.notification.data && event.notification.data.url) || '/pos.html?tab=sinpe';
event.waitUntil(
clients.matchAll({ type: 'window', includeUncontrolled: true }).then((windowClients) => {
for (const client of windowClients) {
if (client.url && (client.url.includes('pos.html') || client.url.includes('index.html'))) {
client.navigate(urlToOpen);
return client.focus();
}
}
if (clients.openWindow) {
return clients.openWindow(urlToOpen);
}
})
);
});