From 749756991493b207997010fcc02e78100f98186e Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Sat, 13 Jun 2026 16:24:15 +0100 Subject: [PATCH] Replace toPromise with async firstValueFrom `Observable.toPromise()` is deprecated in RxJS 7 and removed in 8; `firstValueFrom` is the supported replacement for awaiting a single HTTP emission. Rewrites the loader as `async` to drop the `.then` closure. --- .../src/app/core/config/configuration.service.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/frontend/src/app/core/config/configuration.service.ts b/frontend/src/app/core/config/configuration.service.ts index eb9f486a846..37d558f5f00 100644 --- a/frontend/src/app/core/config/configuration.service.ts +++ b/frontend/src/app/core/config/configuration.service.ts @@ -27,6 +27,7 @@ //++ import { Injectable, inject } from '@angular/core'; +import { firstValueFrom } from 'rxjs'; import moment from 'moment'; import { ConfigurationResource } from 'core-app/features/hal/resources/configuration-resource'; @@ -158,14 +159,7 @@ export class ConfigurationService { return this.configuration.triallingFeatures; } - private loadConfiguration() { - return this - .apiV3Service - .configuration - .get() - .toPromise() - .then((configuration:ConfigurationResource) => { - this.configuration = configuration; - }); + private async loadConfiguration():Promise { + this.configuration = await firstValueFrom(this.apiV3Service.configuration.get()); } }