Skip to content

Commit 0bbcda0

Browse files
committed
Move into constructor
1 parent e077d9c commit 0bbcda0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/vector/init.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ export function preparePlatform() {
4949
console.log("Using Web platform");
5050
PlatformPeg.set(new WebPlatform());
5151
}
52-
// Register service worker if available on this platform
53-
PlatformPeg.get().registerServiceWorker();
5452
}
5553

5654
export async function loadConfig() {

src/vector/platform/WebPlatform.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,18 @@ const POKE_RATE_MS = 10 * 60 * 1000; // 10 min
3434
export default class WebPlatform extends VectorBasePlatform {
3535
private runningVersion: string = null;
3636

37-
getHumanReadableName(): string {
38-
return 'Web Platform'; // no translation required: only used for analytics
39-
}
40-
41-
registerServiceWorker(): void {
37+
constructor() {
38+
super();
39+
// Register service worker if available on this platform
4240
if ('serviceWorker' in navigator) {
4341
navigator.serviceWorker.register('sw.js');
4442
}
4543
}
4644

45+
getHumanReadableName(): string {
46+
return 'Web Platform'; // no translation required: only used for analytics
47+
}
48+
4749
/**
4850
* Returns true if the platform supports displaying
4951
* notifications, otherwise false.

0 commit comments

Comments
 (0)