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.
- package/lib/sw-template.js +4 -15
- package/package.json +1 -1
package/lib/sw-template.js
CHANGED
|
@@ -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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
|
130
|
+
const newVersion = {global, local: info[0].version, escape: oldVersion?.escape}
|
|
142
131
|
//新用户不进行更新操作
|
|
143
132
|
if (!oldVersion || skip) {
|
|
144
133
|
dbVersion.write(newVersion)
|