From 8b0176ddfafdf314861e8763be75f9812a2d9bf5 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 24 Jul 2019 02:16:41 +0900 Subject: [PATCH] Fix error --- src/client/app/mios.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/app/mios.ts b/src/client/app/mios.ts index a73ef45c3..cb25eaa83 100644 --- a/src/client/app/mios.ts +++ b/src/client/app/mios.ts @@ -174,7 +174,7 @@ export default class MiOS extends EventEmitter { // Init service worker if (this.shouldRegisterSw) { this.getMeta().then(data => { - this.registerSw(data.swPublickey); + if (data.swPublickey) this.registerSw(data.swPublickey); }); } }; @@ -291,7 +291,7 @@ export default class MiOS extends EventEmitter { * Register service worker */ @autobind - private registerSw(swPublickey) { + private registerSw(swPublickey: string) { // Check whether service worker and push manager supported const isSwSupported = ('serviceWorker' in navigator) && ('PushManager' in window);