diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-03-06 09:24:16 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-03-06 09:24:16 +0900 |
| commit | 0b27d8a7171b139720bceb36efae6c3906b0ece1 (patch) | |
| tree | fa82ae3b2a4b0c4ee013a593711dbb108ac56f83 /src | |
| parent | [MFM] Improve hashtag parsing (diff) | |
| download | misskey-0b27d8a7171b139720bceb36efae6c3906b0ece1.tar.gz misskey-0b27d8a7171b139720bceb36efae6c3906b0ece1.tar.bz2 misskey-0b27d8a7171b139720bceb36efae6c3906b0ece1.zip | |
Fix #4421
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/app/mios.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/client/app/mios.ts b/src/client/app/mios.ts index eb8af96499..9e191bf43c 100644 --- a/src/client/app/mios.ts +++ b/src/client/app/mios.ts @@ -172,7 +172,11 @@ export default class MiOS extends EventEmitter { callback(); // Init service worker - if (this.shouldRegisterSw) this.registerSw(); + if (this.shouldRegisterSw) { + this.getMeta().then(data => { + this.registerSw(data.swPublickey); + }); + } }; // キャッシュがあったとき @@ -302,7 +306,7 @@ export default class MiOS extends EventEmitter { * Register service worker */ @autobind - private registerSw() { + private registerSw(swPublickey) { // Check whether service worker and push manager supported const isSwSupported = ('serviceWorker' in navigator) && ('PushManager' in window); @@ -328,7 +332,7 @@ export default class MiOS extends EventEmitter { // A public key your push server will use to send // messages to client apps via a push server. - applicationServerKey: urlBase64ToUint8Array(this.meta.data.swPublickey) + applicationServerKey: urlBase64ToUint8Array(swPublickey) }; // Subscribe push notification |