Skip to content

Commit

Permalink
Service Worker: include the demo SVG too (#397)
Browse files Browse the repository at this point in the history
Co-authored-by: Jake Archibald <[email protected]>
  • Loading branch information
XhmikosR and jakearchibald authored Oct 27, 2022
1 parent f7777d1 commit 9e2f427
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 1 addition & 5 deletions src/js/page/ui/main-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,7 @@ export default class MainMenu {
} catch {
this.stopSpinner();

const error = new Error(
'serviceWorker' in navigator && navigator.serviceWorker.controller
? 'Demo not available offline' // TODO: revisit this
: "Couldn't fetch demo SVG",
);
const error = new Error("Couldn't fetch demo SVG");

this.emitter.emit('error', { error });
}
Expand Down
7 changes: 4 additions & 3 deletions src/js/sw/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ addEventListener('install', (event) => {

await cache.addAll([
'./',
'imgs/icon.png',
'all.css',
'changelog.json',
'fonts/code-latin.woff2',
'imgs/icon.png',
'js/gzip-worker.js',
'js/page.js',
'js/prism-worker.js',
'js/svgo-worker.js',
'changelog.json',
'fonts/code-latin.woff2',
'test-svgs/car-lite.svg',
]);

const activeVersion = await activeVersionPromise;
Expand Down

0 comments on commit 9e2f427

Please sign in to comment.