hexo-swpp 2.4.2 → 2.4.3

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.
Files changed (2) hide show
  1. package/lib/sw-template.js +4 -15
  2. package/package.json +1 -1
@@ -19,21 +19,10 @@
19
19
  dbVersion.read().then(oldVersion => {
20
20
  if (oldVersion && oldVersion.escape !== escape) {
21
21
  oldVersion.escape = escape
22
- const rules = new VersionList()
23
- rules.refresh = true
24
22
  // noinspection JSUnresolvedVariable
25
- Promise.all([
26
- dbVersion.write(oldVersion),
27
- deleteCache(rules),
28
- updateJson(true)
29
- ]).then(
30
- args => clients.matchAll().then(
31
- list => list.forEach(client => client.postMessage({
32
- type: 'escape',
33
- version: args[2].version
34
- }))
35
- )
36
- )
23
+ caches.delete(CACHE_NAME)
24
+ .then(() => clients.matchAll())
25
+ .then(list => list.forEach(client => client.postMessage({type: 'escape'})))
37
26
  }
38
27
  })
39
28
  })
@@ -138,7 +127,7 @@
138
127
  /** 解析字符串 */
139
128
  const parseJson = json => dbVersion.read().then(oldVersion => {
140
129
  const {info, global} = json
141
- const newVersion = {global, local: info[0].version, escape: oldVersion.escape}
130
+ const newVersion = {global, local: info[0].version, escape: oldVersion?.escape}
142
131
  //新用户不进行更新操作
143
132
  if (!oldVersion || skip) {
144
133
  dbVersion.write(newVersion)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-swpp",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "hexo-log": "^3.0.0",