Revert "Tidy up Service Worker, only run Workbox in production"
This reverts commit c47532fe
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
87c42934ea
commit
1edbe36547
3 changed files with 86 additions and 97 deletions
|
@ -28,6 +28,11 @@ require('highlight.js/styles/github.css');
|
|||
import {parseQsFromFragment} from "./url_utils";
|
||||
import './modernizr';
|
||||
|
||||
// load service worker if available on this platform
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('service-worker.js');
|
||||
}
|
||||
|
||||
async function settled(...promises: Array<Promise<any>>) {
|
||||
for (const prom of promises) {
|
||||
try {
|
||||
|
|
|
@ -34,17 +34,6 @@ const POKE_RATE_MS = 10 * 60 * 1000; // 10 min
|
|||
export default class WebPlatform extends VectorBasePlatform {
|
||||
private runningVersion: string = null;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
// load service worker if available on this platform
|
||||
// Service worker is disabled in development: https://github.com/GoogleChrome/workbox/issues/1790
|
||||
if ('serviceWorker' in navigator && process.env.NODE_ENV === "production") {
|
||||
navigator.serviceWorker.register('service-worker.js');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getHumanReadableName(): string {
|
||||
return 'Web Platform'; // no translation required: only used for analytics
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue