Skip to content

Commit

Permalink
delete update method, fix main.tsx chache url
Browse files Browse the repository at this point in the history
  • Loading branch information
VladToby committed Oct 9, 2024
1 parent 40e79d7 commit e85d9e0
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions packages/client/public/serviceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ const urlsToCache = [
'/',
'/manifest.json',
'/index.html',
'/favicon.png',
'/main.tsx'
'/favicon.png'
]

const networkFirst = async (request) => {
Expand All @@ -29,18 +28,6 @@ const networkFirst = async (request) => {
}
}

const update = async (request) => {
const cache = await caches.open(DYNAMIC_CACHE_NAME)
try {
const response = await fetch(request)
if (response && response.status === 200 && response.type === 'basic') {
await cache.put(request, response)
}
} catch (error) {
console.error('Update failed', error)
}
}

self.addEventListener('install', (event) => {
event.waitUntil(
caches
Expand Down Expand Up @@ -68,5 +55,4 @@ self.addEventListener('fetch', (event) => {
}

event.respondWith(networkFirst(request))
event.waitUntil(update(request))
})

0 comments on commit e85d9e0

Please sign in to comment.