DM-370: added documine condition

This commit is contained in:
Nicoleta Panaghiu 2023-09-05 18:27:26 +03:00
parent c2e382ec73
commit dad25c7c2e

View File

@ -77,14 +77,15 @@ export class NotificationsScreenComponent extends BaseFormComponent implements O
async save() {
this.#loadingService.start();
try {
const preferences = this.isPreferenceChecked('inAppNotifications', 'ASSIGN_APPROVER')
? this.form.value
: {
...this.form.value,
inAppNotifications: this.form
.get('inAppNotifications')
.value.filter((preference: string) => !RSS_EXCLUDED_SETTINGS.includes(preference)),
};
const preferences =
!this.isPreferenceChecked('inAppNotifications', 'ASSIGN_APPROVER') && this.#config.IS_DOCUMINE
? {
...this.form.value,
inAppNotifications: this.form
.get('inAppNotifications')
.value.filter((preference: string) => !RSS_EXCLUDED_SETTINGS.includes(preference)),
}
: this.form.value;
await firstValueFrom(this.#notificationPreferencesService.update(preferences));
} catch (e) {
this.#toaster.error(_('notifications-screen.error.generic'));