mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 04:23:09 +02:00
通知設定が開けないのを修正
This commit is contained in:
parent
666c9be447
commit
e6112506df
1 changed files with 18 additions and 14 deletions
|
@ -126,7 +126,7 @@ function encode(buffer: ArrayBuffer | null) {
|
||||||
* Convert the URL safe base64 string to a Uint8Array
|
* Convert the URL safe base64 string to a Uint8Array
|
||||||
* @param base64String base64 string
|
* @param base64String base64 string
|
||||||
*/
|
*/
|
||||||
function urlBase64ToUint8Array(base64String: string): Uint8Array {
|
function urlBase64ToUint8Array(base64String: string): Uint8Array {
|
||||||
const padding = '='.repeat((4 - base64String.length % 4) % 4);
|
const padding = '='.repeat((4 - base64String.length % 4) % 4);
|
||||||
const base64 = (base64String + padding)
|
const base64 = (base64String + padding)
|
||||||
.replace(/-/g, '+')
|
.replace(/-/g, '+')
|
||||||
|
@ -141,7 +141,10 @@ function encode(buffer: ArrayBuffer | null) {
|
||||||
return outputArray;
|
return outputArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
navigator.serviceWorker.ready.then(async swr => {
|
if (navigator.serviceWorker == null) {
|
||||||
|
// TODO: よしなに?
|
||||||
|
} else {
|
||||||
|
navigator.serviceWorker.ready.then(async swr => {
|
||||||
registration = swr;
|
registration = swr;
|
||||||
|
|
||||||
pushSubscription = await registration.pushManager.getSubscription();
|
pushSubscription = await registration.pushManager.getSubscription();
|
||||||
|
@ -159,7 +162,8 @@ navigator.serviceWorker.ready.then(async swr => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
pushRegistrationInServer: $$(pushRegistrationInServer),
|
pushRegistrationInServer: $$(pushRegistrationInServer),
|
||||||
|
|
Loading…
Reference in a new issue