Output error if vapid key can't be reached
This commit is contained in:
parent
e3a750df28
commit
099ff10987
1 changed files with 5 additions and 1 deletions
|
@ -13,7 +13,11 @@ const urlBase64ToUint8Array = (base64String) => {
|
||||||
return decodeBase64(base64);
|
return decodeBase64(base64);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getApplicationServerKey = getState => getState().getIn(['auth', 'app', 'vapid_key']);
|
const getApplicationServerKey = getState => {
|
||||||
|
const key = getState().getIn(['auth', 'app', 'vapid_key']);
|
||||||
|
if (!key) console.error('Could not get vapid key. Push notifications will not work.');
|
||||||
|
return key;
|
||||||
|
};
|
||||||
|
|
||||||
const getRegistration = () => navigator.serviceWorker.ready;
|
const getRegistration = () => navigator.serviceWorker.ready;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue