Skip to content

Commit c327bf7

Browse files
committed
[DURACOM-234] Fix merge with main
1 parent 32f1d10 commit c327bf7

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

src/modules/app/browser-app.config.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@ import {
33
provideHttpClient,
44
withInterceptorsFromDi,
55
} from '@angular/common/http';
6-
import {
7-
APP_INITIALIZER,
8-
NgModule,
9-
} from '@angular/core';
106
import {
117
APP_ID,
8+
APP_INITIALIZER,
129
ApplicationConfig,
1310
importProvidersFrom,
1411
makeStateKey,
@@ -53,10 +50,10 @@ import { ClientCookieService } from '../../app/core/services/client-cookie.servi
5350
import { CookieService } from '../../app/core/services/cookie.service';
5451
import { HardRedirectService } from '../../app/core/services/hard-redirect.service';
5552
import { ReferrerService } from '../../app/core/services/referrer.service';
56-
import { BrowserXSRFService } from '../../app/core/xsrf/browser-xsrf.service';
57-
import { XSRFService } from '../../app/core/xsrf/xsrf.service';
5853
import { ClientMathService } from '../../app/core/shared/client-math.service';
5954
import { MathService } from '../../app/core/shared/math.service';
55+
import { BrowserXSRFService } from '../../app/core/xsrf/browser-xsrf.service';
56+
import { XSRFService } from '../../app/core/xsrf/xsrf.service';
6057
import { BrowserKlaroService } from '../../app/shared/cookies/browser-klaro.service';
6158
import { KlaroService } from '../../app/shared/cookies/klaro.service';
6259
import { MissingTranslationHelper } from '../../app/shared/translate/missing-translation.helper';

src/modules/app/browser-init.service.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { Store } from '@ngrx/store';
1818
import { TranslateService } from '@ngx-translate/core';
1919
import {
2020
firstValueFrom,
21+
lastValueFrom,
2122
Subscription,
2223
} from 'rxjs';
2324
import {
@@ -124,7 +125,7 @@ export class BrowserInitService extends InitService {
124125

125126
this.initKlaro();
126127

127-
await this.authenticationReady$().toPromise();
128+
await lastValueFrom(this.authenticationReady$());
128129

129130
return true;
130131
};
@@ -141,10 +142,12 @@ export class BrowserInitService extends InitService {
141142
const state = this.transferState.get<any>(InitService.NGRX_STATE, null);
142143
this.transferState.remove(InitService.NGRX_STATE);
143144
this.store.dispatch(new StoreAction(StoreActionTypes.REHYDRATE, state));
144-
return this.store.select(coreSelector).pipe(
145-
find((core: any) => isNotEmpty(core)),
146-
map(() => true),
147-
).toPromise();
145+
return lastValueFrom(
146+
this.store.select(coreSelector).pipe(
147+
find((core: any) => isNotEmpty(core)),
148+
map(() => true),
149+
),
150+
);
148151
}
149152

150153
private trackAuthTokenExpiration(): void {
@@ -190,7 +193,7 @@ export class BrowserInitService extends InitService {
190193
* @private
191194
*/
192195
private closeAuthCheckSubscription() {
193-
firstValueFrom(this.authenticationReady$()).then(() => {
196+
void firstValueFrom(this.authenticationReady$()).then(() => {
194197
this.sub.unsubscribe();
195198
});
196199
}

src/modules/app/server-init.service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
import {
99
Inject,
1010
Injectable,
11+
TransferState,
1112
} from '@angular/core';
12-
import { TransferState } from '@angular/platform-browser';
1313
import { Store } from '@ngrx/store';
1414
import { TranslateService } from '@ngx-translate/core';
15+
import { lastValueFrom } from 'rxjs';
1516
import { take } from 'rxjs/operators';
1617

1718
import { AppState } from '../../app/app.reducer';
@@ -75,7 +76,7 @@ export class ServerInitService extends InitService {
7576
this.initRouteListeners();
7677
this.themeService.listenForThemeChanges(false);
7778

78-
await this.authenticationReady$().toPromise();
79+
await lastValueFrom(this.authenticationReady$());
7980

8081
return true;
8182
};

0 commit comments

Comments
 (0)