Skip to content

Commit

Permalink
AAAA
Browse files Browse the repository at this point in the history
  • Loading branch information
Daltz333 committed Feb 3, 2022
1 parent 5e5b795 commit 12a1e1d
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions source/_extensions/pwa_service_files/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@ self.addEventListener('install', function(e) {
e.waitUntil(
caches.open('frc-docs').then(function(cache) {
fetch('_static/cache.json')
.then(response => response.json().then(data => {
/*for (const i of data) {
cache.addAll()
}*/
cache.addAll(data).catch(error => {
.then(response => response.json())
.then(async (data) => {
for (let i = 0; i < data.length / 10; i++) {
const tofetch = data.slice(i * 10, i * 10 + 9)
await cache.addAll(tofetch)
}
/*
for (const i of data) {
cache.add(i).catch(error => {
console.error(i, error)
})
}
(cache.addAll(data).catch(error => {
console.error(error)
})
console.log(cache.keys());
}))
})*/
//console.log(cache.keys());
})
.catch(error => {
console.error(error);
});
Expand Down

0 comments on commit 12a1e1d

Please sign in to comment.