From 68359d2fc673bf0c7be48fae904c58e474a78909 Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Tue, 12 Dec 2023 12:34:55 +0200 Subject: [PATCH] UI: Fixed notification settings --- .../settings/notification-settings.component.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui-ngx/src/app/modules/home/pages/notification/settings/notification-settings.component.ts b/ui-ngx/src/app/modules/home/pages/notification/settings/notification-settings.component.ts index b1f4bdd3dc..fc5590039e 100644 --- a/ui-ngx/src/app/modules/home/pages/notification/settings/notification-settings.component.ts +++ b/ui-ngx/src/app/modules/home/pages/notification/settings/notification-settings.component.ts @@ -78,6 +78,13 @@ export class NotificationSettingsComponent extends PageComponent implements OnIn if (settings.prefs) { preparedSettings = this.prepareNotificationSettings(settings.prefs); preparedSettings.forEach((setting) => { + if (!setting.enabled && Object.values(setting.enabledDeliveryMethods).some(deliveryMethod => deliveryMethod === true)) { + const enabledDeliveryMethod = deepClone(setting.enabledDeliveryMethods); + Object.keys(enabledDeliveryMethod).forEach(key => { + enabledDeliveryMethod[key] = false; + }); + setting.enabledDeliveryMethods = enabledDeliveryMethod; + } setting.enabledDeliveryMethods = Object.assign( this.notificationDeliveryMethods.reduce((a, v) => ({ ...a, [v]: true}), {}), setting.enabledDeliveryMethods