mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
Merge pull request #16157 from vector-im/jryans/sw-web-only
Skip the service worker for Electron
This commit is contained in:
commit
2040ea2b82
2 changed files with 8 additions and 5 deletions
|
@ -29,11 +29,6 @@ require('katex/dist/katex.css');
|
||||||
import {parseQsFromFragment} from "./url_utils";
|
import {parseQsFromFragment} from "./url_utils";
|
||||||
import './modernizr';
|
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>>) {
|
async function settled(...promises: Array<Promise<any>>) {
|
||||||
for (const prom of promises) {
|
for (const prom of promises) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -34,6 +34,14 @@ const POKE_RATE_MS = 10 * 60 * 1000; // 10 min
|
||||||
export default class WebPlatform extends VectorBasePlatform {
|
export default class WebPlatform extends VectorBasePlatform {
|
||||||
private runningVersion: string = null;
|
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 {
|
getHumanReadableName(): string {
|
||||||
return 'Web Platform'; // no translation required: only used for analytics
|
return 'Web Platform'; // no translation required: only used for analytics
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue