client: translate comments

This commit is contained in:
Johann150 2022-11-12 18:18:24 +01:00
parent a3468491a7
commit 0c3c855d29
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -33,14 +33,14 @@ export async function initializeSw() {
}) })
// When subscribe failed // When subscribe failed
.catch(async (err: Error) => { .catch(async (err: Error) => {
// 通知が許可されていなかったとき // when notifications were not authorized
if (err.name === 'NotAllowedError') { if (err.name === 'NotAllowedError') {
return; return;
} }
// 違うapplicationServerKey (または gcm_sender_id)のサブスクリプションが // The error may have been caused by the fact that a subscription to a
// 既に存在していることが原因でエラーになった可能性があるので、 // different applicationServerKey (or gcm_sender_id) already exists, so
// そのサブスクリプションを解除しておく // unsubscribe to it.
const subscription = await registration.pushManager.getSubscription(); const subscription = await registration.pushManager.getSubscription();
if (subscription) subscription.unsubscribe(); if (subscription) subscription.unsubscribe();
}); });