Move into constructor
This commit is contained in:
parent
e077d9ca5f
commit
0bbcda09af
2 changed files with 7 additions and 7 deletions
|
@ -49,8 +49,6 @@ export function preparePlatform() {
|
||||||
console.log("Using Web platform");
|
console.log("Using Web platform");
|
||||||
PlatformPeg.set(new WebPlatform());
|
PlatformPeg.set(new WebPlatform());
|
||||||
}
|
}
|
||||||
// Register service worker if available on this platform
|
|
||||||
PlatformPeg.get().registerServiceWorker();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function loadConfig() {
|
export async function loadConfig() {
|
||||||
|
|
|
@ -34,16 +34,18 @@ 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;
|
||||||
|
|
||||||
getHumanReadableName(): string {
|
constructor() {
|
||||||
return 'Web Platform'; // no translation required: only used for analytics
|
super();
|
||||||
}
|
// Register service worker if available on this platform
|
||||||
|
|
||||||
registerServiceWorker(): void {
|
|
||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator) {
|
||||||
navigator.serviceWorker.register('sw.js');
|
navigator.serviceWorker.register('sw.js');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getHumanReadableName(): string {
|
||||||
|
return 'Web Platform'; // no translation required: only used for analytics
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the platform supports displaying
|
* Returns true if the platform supports displaying
|
||||||
* notifications, otherwise false.
|
* notifications, otherwise false.
|
||||||
|
|
Loading…
Reference in a new issue