We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a63851f commit 1782e06Copy full SHA for 1782e06
1 file changed
sw.js
@@ -68,21 +68,17 @@ async function checkForChanges() {
68
let url = "https://api.github.com/repos/ecc521/beginner-javascript-tutorial/commits/master"
69
70
let oldResponse = await caches.match(url)
71
- console.log(oldResponse)
72
let oldHash;
73
if (oldResponse) {
74
oldHash = (await oldResponse.json()).sha
75
- console.log(oldHash)
76
}
77
78
let latestCommit = await fetch(url)
79
await cache.put(url, latestCommit.clone())
80
let hash = (await latestCommit.json()).sha
81
82
- console.log(hash)
83
84
-
85
if (hash !== oldHash) {
+ console.log("Tutorial has changed since data was cached. Updating data in cache.")
86
preload()
87
88
0 commit comments