From eb220544a371617e2cdb25bd7675fe5141f0ac4b Mon Sep 17 00:00:00 2001 From: binwiederhier Date: Sat, 10 Jun 2023 20:51:24 -0400 Subject: [PATCH] Change wording in prefs based on setting --- web/public/static/langs/en.json | 9 +++++---- web/src/components/Preferences.jsx | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/web/public/static/langs/en.json b/web/public/static/langs/en.json index 9571272f..89ca8931 100644 --- a/web/public/static/langs/en.json +++ b/web/public/static/langs/en.json @@ -330,6 +330,11 @@ "prefs_notifications_delete_after_one_day_description": "Notifications are auto-deleted after one day", "prefs_notifications_delete_after_one_week_description": "Notifications are auto-deleted after one week", "prefs_notifications_delete_after_one_month_description": "Notifications are auto-deleted after one month", + "prefs_notifications_web_push_title": "Background notifications", + "prefs_notifications_web_push_enabled_description": "Notifications are received when web app is not running via Web Push", + "prefs_notifications_web_push_disabled_description": "Notification are only received when web app is running", + "prefs_notifications_web_push_enabled": "Enabled", + "prefs_notifications_web_push_disabled": "Disabled", "prefs_users_title": "Manage users", "prefs_users_description": "Add/remove users for your protected topics here. Please note that username and password are stored in the browser's local storage.", "prefs_users_description_no_sync": "Users and passwords are not synchronized to your account.", @@ -368,10 +373,6 @@ "prefs_reservations_dialog_description": "Reserving a topic gives you ownership over the topic, and allows you to define access permissions for other users over the topic.", "prefs_reservations_dialog_topic_label": "Topic", "prefs_reservations_dialog_access_label": "Access", - "prefs_notifications_web_push_title": "Background notifications", - "prefs_notifications_web_push_description": "Receive notifications in the background via Web Push, even when app is not running", - "prefs_notifications_web_push_enabled": "Enabled", - "prefs_notifications_web_push_disabled": "Disabled", "reservation_delete_dialog_description": "Removing a reservation gives up ownership over the topic, and allows others to reserve it. You can keep, or delete existing messages and attachments.", "reservation_delete_dialog_action_keep_title": "Keep cached messages and attachments", "reservation_delete_dialog_action_keep_description": "Messages and attachments that are cached on the server will become publicly visible for people with knowledge of the topic name.", diff --git a/web/src/components/Preferences.jsx b/web/src/components/Preferences.jsx index 7944f9be..5cac0c5a 100644 --- a/web/src/components/Preferences.jsx +++ b/web/src/components/Preferences.jsx @@ -237,7 +237,7 @@ const DeleteAfter = () => { const WebPushEnabled = () => { const { t } = useTranslation(); const labelId = "prefWebPushEnabled"; - const defaultEnabled = useLiveQuery(async () => prefs.webPushEnabled()); + const enabled = useLiveQuery(async () => prefs.webPushEnabled()); const handleChange = async (ev) => { await prefs.setWebPushEnabled(ev.target.value); }; @@ -247,9 +247,9 @@ const WebPushEnabled = () => { } return ( - + - {t("prefs_notifications_web_push_enabled")} {t("prefs_notifications_web_push_disabled")}