You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 20, 2024. It is now read-only.
Hi! I'm getting the following error on my console that's preventing me from enabling the push notifications:
main.js:37 Uncaught DOMException: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.
at urlB64ToUint8Array (http://127.0.0.1:8887/scripts/main.js:37:26)
at subscribeUser (http://127.0.0.1:8887/scripts/main.js:116:32)
at HTMLButtonElement. (http://127.0.0.1:8887/scripts/main.js:69:7)
urlB64ToUint8Array @ main.js:37
It's the line const rawData = window.atob(base64);
that's in the function provided in main.js
function urlB64ToUint8Array(base64String) {
const padding = '='.repeat((4 - base64String.length % 4) % 4);
const base64 = (base64String + padding)
.replace(/-/g, '+')
.replace(/_/g, '/');
const rawData = window.atob(base64);
const outputArray = new Uint8Array(rawData.length);
for (let i = 0; i < rawData.length; ++i) {
outputArray[i] = rawData.charCodeAt(i);
}
return outputArray;
}
I am new to this and have no clue what is going on. Any help/clarification would be GREATLY appreciated. Thanks!