Merge pull request #16157 from vector-im/jryans/sw-web-only

Skip the service worker for Electron
pull/16175/head
J. Ryan Stinnett 2 years ago committed by GitHub
commit 2040ea2b82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/vector/index.ts
  2. 8
      src/vector/platform/WebPlatform.ts

@ -29,11 +29,6 @@ require('katex/dist/katex.css');
import {parseQsFromFragment} from "./url_utils";
import './modernizr';
// load service worker if available on this platform
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js');
}
async function settled(...promises: Array<Promise<any>>) {
for (const prom of promises) {
try {

@ -34,6 +34,14 @@ const POKE_RATE_MS = 10 * 60 * 1000; // 10 min
export default class WebPlatform extends VectorBasePlatform {
private runningVersion: string = null;
constructor() {
super();
// Register service worker if available on this platform
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js');
}
}
getHumanReadableName(): string {
return 'Web Platform'; // no translation required: only used for analytics
}

Loading…
Cancel
Save