@cocreate/pwa 1.10.0 → 1.10.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [1.10.1](https://github.com/CoCreate-app/CoCreate-pwa/compare/v1.10.0...v1.10.1) (2023-09-18)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Add path and pathname ([1eaa09c](https://github.com/CoCreate-app/CoCreate-pwa/commit/1eaa09c1bb7dab55868e02ac4b994b1464a4f38e))
7
+ * bug in cache ([35229bc](https://github.com/CoCreate-app/CoCreate-pwa/commit/35229bc521e867ece5bc8140d9cdfcde0587220b))
8
+ * set cache name ([35fcedd](https://github.com/CoCreate-app/CoCreate-pwa/commit/35fceddf099cb74a028a8ae2448e6d6ee4cb9ee4))
9
+ * Update CoCreate depndencies to latest versions ([42fca0a](https://github.com/CoCreate-app/CoCreate-pwa/commit/42fca0a8852974cf5aec912e00c1b2d8dc7ff0f6))
10
+
1
11
  # [1.10.0](https://github.com/CoCreate-app/CoCreate-pwa/compare/v1.9.2...v1.10.0) (2023-09-17)
2
12
 
3
13
 
@@ -8,17 +8,16 @@ module.exports = {
8
8
  "object": {
9
9
  "_id": "637ca5ac50234ef1671ce327",
10
10
  "name": "index.html",
11
- "path": "/docs/pwa/index.html",
11
+ "path": "/docs/pwa",
12
+ "pathname": "/docs/pwa/index.html",
12
13
  "src": "{{./docs/index.html}}",
13
14
  "host": [
14
15
  "cocreate.app",
15
16
  "general.cocreate.app"
16
17
  ],
17
- "directory": "/docs/pwa",
18
- "parentDirectory": "{{parentDirectory}}",
18
+ "directory": "pwa",
19
19
  "content-type": "{{content-type}}",
20
- "public": "true",
21
- "website_id": "614298c2829b690010a5c031"
20
+ "public": "true"
22
21
  }
23
22
  }
24
23
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/pwa",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "A simple pwa component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "pwa",
@@ -59,6 +59,6 @@
59
59
  "webpack-log": "^3.0.1"
60
60
  },
61
61
  "dependencies": {
62
- "@cocreate/local-storage": "^1.10.0"
62
+ "@cocreate/local-storage": "^1.10.1"
63
63
  }
64
64
  }
package/src/cache.js CHANGED
@@ -54,7 +54,7 @@ function fileChange(data) {
54
54
  return
55
55
 
56
56
  for (let i = 0; i < data.object.length; i++)
57
- putFile('test', data.object[i])
57
+ putFile('dynamic-v2', data.object[i])
58
58
  }
59
59
 
60
60
  socket.listen('create.object', (data) => fileChange(data));
@@ -46,7 +46,7 @@ self.addEventListener("fetch", async (e) => {
46
46
  caches
47
47
  .match(e.request)
48
48
  .then(async (cacheResponse) => {
49
- if (!navigator.onLine && !!cacheResponse && cacheType !== 'false') {
49
+ if (!navigator.onLine || !!cacheResponse && cacheType !== 'false') {
50
50
  return cacheResponse;
51
51
  } else {
52
52
  const networkResponse = await fetch(e.request);
@@ -58,10 +58,6 @@ self.addEventListener("fetch", async (e) => {
58
58
  if (storageHeader)
59
59
  storage = storageHeader
60
60
 
61
- if (!cacheResponse || cacheType === 'false' || cacheType === 'offline') {
62
- return networkResponse.clone();
63
- }
64
-
65
61
  if (cacheType && cacheType !== 'false') {
66
62
  console.log('caching')
67
63
 
@@ -86,6 +82,10 @@ self.addEventListener("fetch", async (e) => {
86
82
  });
87
83
  }
88
84
 
85
+ if (!cacheResponse || cacheType === 'false' || cacheType === 'offline') {
86
+ return networkResponse.clone();
87
+ }
88
+
89
89
  }
90
90
 
91
91
  if (!!cacheResponse && cacheType !== 'false' && cacheType !== 'offline') {