disable streaming download if registering sw fails. fixes #1226
This commit is contained in:
parent
9da70931e4
commit
f78e025d33
1 changed files with 7 additions and 2 deletions
|
@ -35,8 +35,13 @@ if (process.env.NODE_ENV === 'production') {
|
||||||
return window.location.assign('/unsupported/crypto');
|
return window.location.assign('/unsupported/crypto');
|
||||||
}
|
}
|
||||||
if (capabilities.serviceWorker) {
|
if (capabilities.serviceWorker) {
|
||||||
await navigator.serviceWorker.register('/serviceWorker.js');
|
try {
|
||||||
await navigator.serviceWorker.ready;
|
await navigator.serviceWorker.register('/serviceWorker.js');
|
||||||
|
await navigator.serviceWorker.ready;
|
||||||
|
} catch (e) {
|
||||||
|
// continue but disable streaming downloads
|
||||||
|
capabilities.streamDownload = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const translate = await getTranslator(LOCALE);
|
const translate = await getTranslator(LOCALE);
|
||||||
|
|
Loading…
Reference in a new issue