Skip to content

Commit

Permalink
copy: change web push error instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
th0rgall committed Jul 8, 2024
1 parent c4932e5 commit cbc5b4b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/webpush.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 11 additions & 1 deletion src/lib/api/push-registrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand All @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
}
}
}
2 changes: 1 addition & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
}
}
}
2 changes: 1 addition & 1 deletion src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
}
}
}
2 changes: 1 addition & 1 deletion src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 sest produit lors de lactivation 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 !"
}
}
}
2 changes: 1 addition & 1 deletion src/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
}
}
}

0 comments on commit cbc5b4b

Please sign in to comment.