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() { async save() {
this.#loadingService.start(); this.#loadingService.start();
try { try {
const preferences = this.isPreferenceChecked('inAppNotifications', 'ASSIGN_APPROVER') const preferences =
? this.form.value !this.isPreferenceChecked('inAppNotifications', 'ASSIGN_APPROVER') && this.#config.IS_DOCUMINE
: { ? {
...this.form.value, ...this.form.value,
inAppNotifications: this.form inAppNotifications: this.form
.get('inAppNotifications') .get('inAppNotifications')
.value.filter((preference: string) => !RSS_EXCLUDED_SETTINGS.includes(preference)), .value.filter((preference: string) => !RSS_EXCLUDED_SETTINGS.includes(preference)),
}; }
: this.form.value;
await firstValueFrom(this.#notificationPreferencesService.update(preferences)); await firstValueFrom(this.#notificationPreferencesService.update(preferences));
} catch (e) { } catch (e) {
this.#toaster.error(_('notifications-screen.error.generic')); this.#toaster.error(_('notifications-screen.error.generic'));