@learnpack/learnpack 5.0.359 → 5.0.361

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/ui/_app/sw.js CHANGED
@@ -1,5 +1,7 @@
1
1
  self.addEventListener('install', (event) => {
2
2
  console.log('Service Worker instalado');
3
+ // Replace an older worker right away instead of waiting for every tab to close
4
+ self.skipWaiting();
3
5
  event.waitUntil(
4
6
  caches.open('app-cache').then(async (cache) => {
5
7
  const urlsToCache = [
@@ -20,7 +22,18 @@ self.addEventListener('install', (event) => {
20
22
  );
21
23
  });
22
24
 
25
+ self.addEventListener('activate', (event) => {
26
+ event.waitUntil(self.clients.claim());
27
+ });
28
+
23
29
  self.addEventListener('fetch', (event) => {
30
+ // In GitHub Codespaces the forwarded port is private: GitHub redirects
31
+ // requests to its sign-in flow, which only completes on a real network
32
+ // navigation. Serving "/" from cache blocks it, so stay out of the way.
33
+ if (self.location.hostname.endsWith('.app.github.dev')) {
34
+ return;
35
+ }
36
+
24
37
  // Excluir solicitudes a /socket.io/ y otras URLs que no deben ser cacheadas
25
38
  if (event.request.url.includes('/socket.io/') ||
26
39
  event.request.url.includes('/api/') ||
package/src/ui/app.tar.gz CHANGED
Binary file