summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkPushNotificationAllowButton.vue
diff options
context:
space:
mode:
Diffstat (limited to 'packages/frontend/src/components/MkPushNotificationAllowButton.vue')
-rw-r--r--packages/frontend/src/components/MkPushNotificationAllowButton.vue9
1 files changed, 4 insertions, 5 deletions
diff --git a/packages/frontend/src/components/MkPushNotificationAllowButton.vue b/packages/frontend/src/components/MkPushNotificationAllowButton.vue
index 9c37eb5e72..697346020c 100644
--- a/packages/frontend/src/components/MkPushNotificationAllowButton.vue
+++ b/packages/frontend/src/components/MkPushNotificationAllowButton.vue
@@ -90,7 +90,7 @@ function subscribe() {
publickey: encode(subscription.getKey('p256dh')),
});
}, async err => { // When subscribe failed
- // 通知が許可されていなかったとき
+ // 通知が許可されていなかったとき
if (err?.name === 'NotAllowedError') {
console.info('User denied the notification permission request.');
return;
@@ -114,14 +114,13 @@ async function unsubscribe() {
if ($i && accounts.length >= 2) {
apiWithDialog('sw/unregister', {
- i: $i.token,
endpoint,
- });
+ }, $i.token);
} else {
pushSubscription.value.unsubscribe();
apiWithDialog('sw/unregister', {
endpoint,
- });
+ }, null);
pushSubscription.value = null;
}
}
@@ -134,7 +133,7 @@ function encode(buffer: ArrayBuffer | null) {
* Convert the URL safe base64 string to a Uint8Array
* @param base64String base64 string
*/
-function urlBase64ToUint8Array(base64String: string): Uint8Array {
+function urlBase64ToUint8Array(base64String: string): BufferSource {
const padding = '='.repeat((4 - base64String.length % 4) % 4);
const base64 = (base64String + padding)
.replace(/-/g, '+')