diff --git a/docs/webpush.md b/docs/webpush.md index f9b36b7d..329b3669 100644 --- a/docs/webpush.md +++ b/docs/webpush.md @@ -27,7 +27,7 @@ nvm use 16 && yarn run firebase:staging-push ## Gotchas -- Generally, **service workers** only allowed on HTTP on **localhost**. On other hosts, **HTTPS is required**. +- Generally, **service workers** are only allowed on HTTP on **localhost**. On other hosts, **HTTPS is required**. - Firebase emulator limitations: 1. Firebase emulators do not support being served over HTTPS (all) 2. Firebase JS SDK emulator connectors do not support _connecting_ to HTTPS-based emulators (all except Auth) diff --git a/src/lib/api/push-registrations.ts b/src/lib/api/push-registrations.ts index 34876e98..e9fb08d8 100644 --- a/src/lib/api/push-registrations.ts +++ b/src/lib/api/push-registrations.ts @@ -403,6 +403,12 @@ export const getDeviceUAWithClientHints = async () => { * - undefined otherwise */ export const createPushRegistration = async () => { + + /** + * Shows an error in a modal with the given description. Also includes user agent information. + * @param error + * @param specifier HTML string + */ const handleErrorGeneric = (error: unknown, specifier: string) => { rootModal.set( bind(ErrorModal, { @@ -413,7 +419,11 @@ export const createPushRegistration = async () => { isEnablingLocalPushRegistration.set(false); }; - // Optional extra info in English just for us + /** + * Displays a general-purpose error message related to notifications, with optional extra info. + * @param error + * @param extraInfo + */ const handleError = (error: unknown, extraInfo?: string) => { const errorModalSpecifier = get(t)('push-notifications.error.generic', { values: { diff --git a/src/locales/de.json b/src/locales/de.json index 64b88ccd..a30ef05a 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -1496,7 +1496,7 @@ "error": { "permission-denied": "Ihr Browser blockiert derzeit mobile Benachrichtigungen für WTMG. Um Benachrichtigungen zu aktivieren, aktualisieren Sie oder setzen Sie Ihre Browserberechtigungen zurück. Folgen Sie einfach dem {faqLink}. Es dauert nur zwei Minuten!", "permission-denied-faq-text": "Anleitungen dazu finden Sie in unseren FAQ", - "generic": "Beim Aktivieren mobiler Benachrichtigungen ist ein Fehler aufgetreten. Bitte senden Sie die folgenden Informationen an {emailLink} und wir helfen Ihnen weiter. Vielen Dank!" + "generic": "Beim Aktivieren mobiler Benachrichtigungen ist ein Fehler aufgetreten. Können Sie diese Seite aktualisieren und dann erneut versuchen, sie zu aktivieren? Wenn dies nicht funktioniert, senden Sie bitte die folgenden Informationen an {emailLink} und wir helfen Ihnen weiter. Vielen Dank!" } } } diff --git a/src/locales/en.json b/src/locales/en.json index 5ba28f43..32218a9e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1509,7 +1509,7 @@ "permission-denied": "Your browser is currently blocking mobile notifications for WTMG. To turn on notifications, update or reset your browser permissions. Simply follow the {faqLink}. It only takes two minutes!", "permission-denied-faq-link": "https://help.welcometomygarden.org/master/1.-mobile-notifications/1.1-android#what-if-my-browser-is-blocking-mobile-notifications-specifically-for-wtmg", "permission-denied-faq-text": "instructions in our FAQ", - "generic": "Something went wrong while turning on mobile notifications. Please send the information below to {emailLink}, and we will help you further. Thank you!" + "generic": "Something went wrong when turning on your mobile notifications. Can you refresh this page and then try turning them on again? If this doesn't work, please send the information below to {emailLink} so we can help you further. Thanks!" } } } diff --git a/src/locales/es.json b/src/locales/es.json index 3e442c34..a9e21ae3 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -1494,7 +1494,7 @@ "error": { "permission-denied": "Actualmente, su navegador está bloqueando las notificaciones móviles de WTMG. Para activar las notificaciones, actualice o restablezca los permisos de su navegador. Simplemente siga el {faqLink}. ¡Solo lleva dos minutos!", "permission-denied-faq-text": "instrucciones en nuestras preguntas frecuentes", - "generic": "Algo salió mal al activar las notificaciones móviles. Envíe la siguiente información a {emailLink} y le ayudaremos más. ¡Gracias!" + "generic": "Algo salió mal al activar las notificaciones móviles. ¿Puedes actualizar esta página e intentar activarlas de nuevo? Si esto no funciona, envíanos la siguiente información a {emailLink} para que podamos ayudarte mejor. ¡Gracias!" } } } diff --git a/src/locales/fr.json b/src/locales/fr.json index d453b252..cc310659 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -1487,7 +1487,7 @@ "permission-denied-faq-link": "https://aide.welcometomygarden.org/master/1.-notifications-mobiles/1.1.-android#que-faire-si-mon-navigateur-bloque-les-notifications-uniquement-sur-wtmg", "permission-denied-faq-text": "les instructions dans notre FAQ", "permission-denied": "Votre navigateur bloque actuellement les notifications mobiles pour WTMG. Pour les activer, autorisez les notifications dans votre navigateur. Suivez {faqLink}. Cela ne prend que deux minutes !\"", - "generic": "Un problème s'est produit lors de l'activation des notifications mobiles. Envoyez les informations ci-dessous à {emailLink} pour que nous puissions résoudre le problème. Merci !" + "generic": "Un problème s’est produit lors de l’activation de vos notifications mobiles. Pouvez-vous actualiser cette page et réessayer de les activer ? Si cela ne fonctionne pas, merci d'envoyer les informations ci-dessous à {emailLink} afin que nous puissions vous aider. Merci !" } } } diff --git a/src/locales/nl.json b/src/locales/nl.json index 62b44a4a..62b4f4a1 100644 --- a/src/locales/nl.json +++ b/src/locales/nl.json @@ -1494,7 +1494,7 @@ "permission-denied-faq-link": "https://hulp.welcometomygarden.org/master/1.-mobiele-meldingen/1.1.-android#wat-moet-ik-doen-als-mijn-browser-mobiele-meldingen-specifiek-voor-wtmg-blokkeert", "permission-denied-faq-text": "de instructies in onze FAQ", "permission-denied": "Jouw browser blokkeert momenteel mobiele meldingen voor WTMG. Werk de toestemmingen van jouw browser bij of reset ze om mobiele meldingen aan te zetten. Volg eenvoudigweg {faqLink}. Het duurt slechts twee minuten!", - "generic": "Er is iets misgegaan bij het aanzetten van mobiele meldingen. Stuur onderstaande informatie naar {emailLink} zodat we je verder kunnen helpen. Bedankt!" + "generic": "Er is iets misgegaan bij het aanzetten van je mobiele meldingen. Kan je deze pagina verversen en dan nogmaals proberen om ze aan te zetten? Als dit niet werkt, gelieve dan onderstaande informatie naar {emailLink} te sturen zodat we je verder kunnen helpen. Bedankt!" } } }