[DURACOM-234] Fix merge with main

This commit is contained in:
Giuseppe Digilio
2024-04-04 09:58:10 +02:00
parent 32f1d1096a
commit c327bf744b
3 changed files with 15 additions and 14 deletions

View File

@@ -3,12 +3,9 @@ import {
provideHttpClient, provideHttpClient,
withInterceptorsFromDi, withInterceptorsFromDi,
} from '@angular/common/http'; } from '@angular/common/http';
import {
APP_INITIALIZER,
NgModule,
} from '@angular/core';
import { import {
APP_ID, APP_ID,
APP_INITIALIZER,
ApplicationConfig, ApplicationConfig,
importProvidersFrom, importProvidersFrom,
makeStateKey, makeStateKey,
@@ -53,10 +50,10 @@ import { ClientCookieService } from '../../app/core/services/client-cookie.servi
import { CookieService } from '../../app/core/services/cookie.service'; import { CookieService } from '../../app/core/services/cookie.service';
import { HardRedirectService } from '../../app/core/services/hard-redirect.service'; import { HardRedirectService } from '../../app/core/services/hard-redirect.service';
import { ReferrerService } from '../../app/core/services/referrer.service'; import { ReferrerService } from '../../app/core/services/referrer.service';
import { BrowserXSRFService } from '../../app/core/xsrf/browser-xsrf.service';
import { XSRFService } from '../../app/core/xsrf/xsrf.service';
import { ClientMathService } from '../../app/core/shared/client-math.service'; import { ClientMathService } from '../../app/core/shared/client-math.service';
import { MathService } from '../../app/core/shared/math.service'; import { MathService } from '../../app/core/shared/math.service';
import { BrowserXSRFService } from '../../app/core/xsrf/browser-xsrf.service';
import { XSRFService } from '../../app/core/xsrf/xsrf.service';
import { BrowserKlaroService } from '../../app/shared/cookies/browser-klaro.service'; import { BrowserKlaroService } from '../../app/shared/cookies/browser-klaro.service';
import { KlaroService } from '../../app/shared/cookies/klaro.service'; import { KlaroService } from '../../app/shared/cookies/klaro.service';
import { MissingTranslationHelper } from '../../app/shared/translate/missing-translation.helper'; import { MissingTranslationHelper } from '../../app/shared/translate/missing-translation.helper';

View File

@@ -18,6 +18,7 @@ import { Store } from '@ngrx/store';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { import {
firstValueFrom, firstValueFrom,
lastValueFrom,
Subscription, Subscription,
} from 'rxjs'; } from 'rxjs';
import { import {
@@ -124,7 +125,7 @@ export class BrowserInitService extends InitService {
this.initKlaro(); this.initKlaro();
await this.authenticationReady$().toPromise(); await lastValueFrom(this.authenticationReady$());
return true; return true;
}; };
@@ -141,10 +142,12 @@ export class BrowserInitService extends InitService {
const state = this.transferState.get<any>(InitService.NGRX_STATE, null); const state = this.transferState.get<any>(InitService.NGRX_STATE, null);
this.transferState.remove(InitService.NGRX_STATE); this.transferState.remove(InitService.NGRX_STATE);
this.store.dispatch(new StoreAction(StoreActionTypes.REHYDRATE, state)); this.store.dispatch(new StoreAction(StoreActionTypes.REHYDRATE, state));
return this.store.select(coreSelector).pipe( return lastValueFrom(
find((core: any) => isNotEmpty(core)), this.store.select(coreSelector).pipe(
map(() => true), find((core: any) => isNotEmpty(core)),
).toPromise(); map(() => true),
),
);
} }
private trackAuthTokenExpiration(): void { private trackAuthTokenExpiration(): void {
@@ -190,7 +193,7 @@ export class BrowserInitService extends InitService {
* @private * @private
*/ */
private closeAuthCheckSubscription() { private closeAuthCheckSubscription() {
firstValueFrom(this.authenticationReady$()).then(() => { void firstValueFrom(this.authenticationReady$()).then(() => {
this.sub.unsubscribe(); this.sub.unsubscribe();
}); });
} }

View File

@@ -8,10 +8,11 @@
import { import {
Inject, Inject,
Injectable, Injectable,
TransferState,
} from '@angular/core'; } from '@angular/core';
import { TransferState } from '@angular/platform-browser';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { lastValueFrom } from 'rxjs';
import { take } from 'rxjs/operators'; import { take } from 'rxjs/operators';
import { AppState } from '../../app/app.reducer'; import { AppState } from '../../app/app.reducer';
@@ -75,7 +76,7 @@ export class ServerInitService extends InitService {
this.initRouteListeners(); this.initRouteListeners();
this.themeService.listenForThemeChanges(false); this.themeService.listenForThemeChanges(false);
await this.authenticationReady$().toPromise(); await lastValueFrom(this.authenticationReady$());
return true; return true;
}; };