Skip to content

Commit

Permalink
simplify away dev mode cache busting for service worker
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Apr 28, 2024
1 parent ca1793f commit cd18f77
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ui/site/src/serviceWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ export default async function () {
self.location.href, // eslint-disable-line no-restricted-globals
);
workerUrl.searchParams.set('asset-url', document.body.getAttribute('data-asset-url')!);
if (document.body.getAttribute('data-dev')) workerUrl.searchParams.set('dev', '1');
const updateViaCache = document.body.getAttribute('data-dev') ? 'none' : 'all';
const reg = await navigator.serviceWorker.register(workerUrl.href, {
scope: '/',
updateViaCache,
updateViaCache: 'all',
});
const store = storage.make('push-subscribed');
const vapid = document.body.getAttribute('data-vapid');
Expand Down

0 comments on commit cd18f77

Please sign in to comment.