diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-06-05 19:47:08 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-05 19:47:08 +0900 |
| commit | 407a965c1d78db9b13ec89a7be910b3c120aafcf (patch) | |
| tree | 33e00f7a00c4e33b2c95a6e2aba85cea7b9f05f6 /packages/frontend/src/components/MkPushNotificationAllowButton.vue | |
| parent | Merge pull request #10833 from misskey-dev/develop (diff) | |
| parent | Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop (diff) | |
| download | misskey-407a965c1d78db9b13ec89a7be910b3c120aafcf.tar.gz misskey-407a965c1d78db9b13ec89a7be910b3c120aafcf.tar.bz2 misskey-407a965c1d78db9b13ec89a7be910b3c120aafcf.zip | |
Merge pull request #10932 from misskey-dev/develop
Release: 13.13.0
Diffstat (limited to 'packages/frontend/src/components/MkPushNotificationAllowButton.vue')
| -rw-r--r-- | packages/frontend/src/components/MkPushNotificationAllowButton.vue | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/packages/frontend/src/components/MkPushNotificationAllowButton.vue b/packages/frontend/src/components/MkPushNotificationAllowButton.vue index b98c814f24..448084d9ba 100644 --- a/packages/frontend/src/components/MkPushNotificationAllowButton.vue +++ b/packages/frontend/src/components/MkPushNotificationAllowButton.vue @@ -72,28 +72,28 @@ function subscribe() { userVisibleOnly: true, applicationServerKey: urlBase64ToUint8Array(instance.swPublickey), }) - .then(async subscription => { - pushSubscription = subscription; + .then(async subscription => { + pushSubscription = subscription; - // Register - pushRegistrationInServer = await api('sw/register', { - endpoint: subscription.endpoint, - auth: encode(subscription.getKey('auth')), - publickey: encode(subscription.getKey('p256dh')), - }); - }, async err => { // When subscribe failed + // Register + pushRegistrationInServer = await api('sw/register', { + endpoint: subscription.endpoint, + auth: encode(subscription.getKey('auth')), + publickey: encode(subscription.getKey('p256dh')), + }); + }, async err => { // When subscribe failed // 通知が許可されていなかったとき - if (err?.name === 'NotAllowedError') { - console.info('User denied the notification permission request.'); - return; - } + if (err?.name === 'NotAllowedError') { + console.info('User denied the notification permission request.'); + return; + } - // 違うapplicationServerKey (または gcm_sender_id)のサブスクリプションが - // 既に存在していることが原因でエラーになった可能性があるので、 - // そのサブスクリプションを解除しておく - // (これは実行されなさそうだけど、おまじない的に古い実装から残してある) - await unsubscribe(); - }), null, null); + // 違うapplicationServerKey (または gcm_sender_id)のサブスクリプションが + // 既に存在していることが原因でエラーになった可能性があるので、 + // そのサブスクリプションを解除しておく + // (これは実行されなさそうだけど、おまじない的に古い実装から残してある) + await unsubscribe(); + }), null, null); } async function unsubscribe() { |