From c71c6667e03cae24b718803363e71b91e83b0c8c Mon Sep 17 00:00:00 2001 From: Andreas Awouters Date: Wed, 11 Dec 2024 10:10:16 +0100 Subject: [PATCH] 119602: Improve notification hiding toggle useability --- src/app/accessibility/accessibility-settings.service.ts | 8 ++++---- .../accessibility-settings.component.html | 4 ++-- src/assets/i18n/en.json5 | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/accessibility/accessibility-settings.service.ts b/src/app/accessibility/accessibility-settings.service.ts index e9e41954c7c..813bccd4706 100644 --- a/src/app/accessibility/accessibility-settings.service.ts +++ b/src/app/accessibility/accessibility-settings.service.ts @@ -42,7 +42,7 @@ export type AccessibilitySettings = Partial; * The accessibility settings object format used by the accessibility-settings component form. */ export interface AccessibilitySettingsFormValues { - disableNotificationTimeOut: boolean, + notificationTimeOutEnabled: boolean, notificationTimeOut: string, liveRegionTimeOut: string, } @@ -250,8 +250,8 @@ export class AccessibilitySettingsService { */ convertFormValuesToStoredValues(settings: AccessibilitySettingsFormValues): FullAccessibilitySettings { return { - notificationTimeOut: settings.disableNotificationTimeOut ? '0' - : secondsToMilliseconds(settings.notificationTimeOut), + notificationTimeOut: settings.notificationTimeOutEnabled ? + secondsToMilliseconds(settings.notificationTimeOut) : '0', liveRegionTimeOut: secondsToMilliseconds(settings.liveRegionTimeOut), }; } @@ -261,7 +261,7 @@ export class AccessibilitySettingsService { */ convertStoredValuesToFormValues(settings: AccessibilitySettings): AccessibilitySettingsFormValues { return { - disableNotificationTimeOut: parseFloat(settings.notificationTimeOut) === 0, + notificationTimeOutEnabled: parseFloat(settings.notificationTimeOut) !== 0, notificationTimeOut: millisecondsToSeconds(settings.notificationTimeOut), liveRegionTimeOut: millisecondsToSeconds(settings.liveRegionTimeOut), }; diff --git a/src/app/info/accessibility-settings/accessibility-settings.component.html b/src/app/info/accessibility-settings/accessibility-settings.component.html index 5a5493f0bea..cacfae61fce 100644 --- a/src/app/info/accessibility-settings/accessibility-settings.component.html +++ b/src/app/info/accessibility-settings/accessibility-settings.component.html @@ -9,7 +9,7 @@

{{ 'info.accessibility-settings.title' | translate }}

@@ -31,7 +31,7 @@

{{ 'info.accessibility-settings.title' | translate }}

diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 54286d60744..94126bbc168 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -1844,7 +1844,7 @@ "info.accessibility-settings.breadcrumbs": "Accessibility settings", - "info.accessibility-settings.disableNotificationTimeOut.label": "Disable automatic notification hiding", + "info.accessibility-settings.disableNotificationTimeOut.label": "Hide notifications automatically", "info.accessibility-settings.disableNotificationTimeOut.hint": "When this toggle is activated, notifications will remain until manually closed.",