Skip to content
Snippets Groups Projects
Commit 2f590138 authored by Greg Fodor's avatar Greg Fodor
Browse files

Another fix for Chrome's call to permissionState

parent 1c431ee1
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,15 @@ export default class Subscriptions { ...@@ -51,7 +51,15 @@ export default class Subscriptions {
while (this.registration === undefined) await nextTick(); while (this.registration === undefined) await nextTick();
if (!this.registration || !this.registration.pushManager) return null; if (!this.registration || !this.registration.pushManager) return null;
try { try {
if ((await this.registration.pushManager.permissionState()) !== "granted") return null; const convertedVapidKey = urlBase64ToUint8Array(this.vapidPublicKey);
if (
(await this.registration.pushManager.permissionState({
userVisibleOnly: true,
applicationServerKey: convertedVapidKey
})) !== "granted"
)
return null;
} catch (e) { } catch (e) {
return null; // Chrome can throw here complaining about userVisible if push is not right return null; // Chrome can throw here complaining about userVisible if push is not right
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment