diff --git a/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.ts b/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.ts index 73657ced5..0038d6377 100644 --- a/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.ts +++ b/apps/red-ui/src/app/modules/account/screens/notifications/notifications-screen/notifications-screen.component.ts @@ -10,6 +10,7 @@ import { NotificationGroupsKeys, NotificationGroupsValues, } from '@red/domain'; +import { firstValueFrom } from 'rxjs'; @Component({ selector: 'redaction-notifications-screen', @@ -67,7 +68,7 @@ export class NotificationsScreenComponent implements OnInit { async save() { this._loadingService.start(); try { - await this._notificationPreferencesService.update(this.formGroup.value).toPromise(); + await firstValueFrom(this._notificationPreferencesService.update(this.formGroup.value)); } catch (e) { this._toaster.error(_('notifications-screen.error.generic')); } @@ -87,7 +88,7 @@ export class NotificationsScreenComponent implements OnInit { private async _initializeForm() { this._loadingService.start(); - const notificationPreferences = await this._notificationPreferencesService.get().toPromise(); + const notificationPreferences = await firstValueFrom(this._notificationPreferencesService.get()); this.formGroup.patchValue(notificationPreferences); this._loadingService.stop(); diff --git a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts index 566ae678e..731d5c6a0 100644 --- a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts +++ b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts @@ -9,6 +9,7 @@ import { PermissionsService } from '@services/permissions.service'; import { UserService } from '@services/user.service'; import { ConfigService } from '../../../../../services/config.service'; import { LanguageService } from '../../../../../i18n/language.service'; +import { firstValueFrom } from 'rxjs'; @Component({ selector: 'redaction-user-profile-screen', @@ -76,14 +77,14 @@ export class UserProfileScreenComponent implements OnInit { const value = this.form.getRawValue() as IProfile; delete value.language; - await this._userService - .updateMyProfile({ + await firstValueFrom( + this._userService.updateMyProfile({ ...value, - }) - .toPromise(); + }), + ); await this._userService.loadCurrentUser(); - await this._userService.loadAll().toPromise(); + await firstValueFrom(this._userService.loadAll()); } this._initializeForm();