split serviceWorker and streamDownload capabilities

This commit is contained in:
Danny Coates 2018-12-10 12:47:23 -08:00
parent 81cf84b131
commit 61299dd8ea
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
2 changed files with 6 additions and 5 deletions

View file

@ -28,8 +28,9 @@ if (process.env.NODE_ENV === 'production') {
(async function start() {
const app = routes(choo());
const capa = await capabilities();
if (capa.streamDownload) {
navigator.serviceWorker.register('/serviceWorker.js');
if (capa.serviceWorker) {
await navigator.serviceWorker.register('/serviceWorker.js');
await navigator.serviceWorker.ready;
}
const translate = await getTranslator(LOCALE);