Move into constructor

pull/16157/head
J. Ryan Stinnett 2 years ago
parent e077d9ca5f
commit 0bbcda09af
  1. 2
      src/vector/init.tsx
  2. 12
      src/vector/platform/WebPlatform.ts

@ -49,8 +49,6 @@ export function preparePlatform() {
console.log("Using Web platform");
PlatformPeg.set(new WebPlatform());
}
// Register service worker if available on this platform
PlatformPeg.get().registerServiceWorker();
}
export async function loadConfig() {

@ -34,16 +34,18 @@ const POKE_RATE_MS = 10 * 60 * 1000; // 10 min
export default class WebPlatform extends VectorBasePlatform {
private runningVersion: string = null;
getHumanReadableName(): string {
return 'Web Platform'; // no translation required: only used for analytics
}
registerServiceWorker(): void {
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
}
/**
* Returns true if the platform supports displaying
* notifications, otherwise false.

Loading…
Cancel
Save