Fix error
This commit is contained in:
parent
ac914af9c3
commit
238edd36f7
1 changed files with 2 additions and 2 deletions
|
@ -174,7 +174,7 @@ export default class MiOS extends EventEmitter {
|
||||||
// Init service worker
|
// Init service worker
|
||||||
if (this.shouldRegisterSw) {
|
if (this.shouldRegisterSw) {
|
||||||
this.getMeta().then(data => {
|
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
|
* Register service worker
|
||||||
*/
|
*/
|
||||||
@autobind
|
@autobind
|
||||||
private registerSw(swPublickey) {
|
private registerSw(swPublickey: string) {
|
||||||
// Check whether service worker and push manager supported
|
// Check whether service worker and push manager supported
|
||||||
const isSwSupported =
|
const isSwSupported =
|
||||||
('serviceWorker' in navigator) && ('PushManager' in window);
|
('serviceWorker' in navigator) && ('PushManager' in window);
|
||||||
|
|
Loading…
Reference in a new issue