93219: Move theme/route subscriptions from AppComponent to ThemeService

This commit is contained in:
Yura Bondarenko
2022-07-22 12:12:21 +02:00
parent 5cb737c7f2
commit bdc004f64d
11 changed files with 268 additions and 217 deletions

View File

@@ -25,6 +25,7 @@ import { BreadcrumbsService } from '../../app/breadcrumbs/breadcrumbs.service';
import { CSSVariableService } from '../../app/shared/sass-helper/sass-helper.service';
import { KlaroService } from '../../app/shared/cookies/klaro.service';
import { AuthService } from '../../app/core/auth/auth.service';
import { ThemeService } from '../../app/shared/theme-support/theme.service';
/**
* Performs client-side initialization.
@@ -46,6 +47,7 @@ export class BrowserInitService extends InitService {
protected cssService: CSSVariableService,
@Optional() protected klaroService: KlaroService,
protected authService: AuthService,
protected themeService: ThemeService,
) {
super(
store,
@@ -59,6 +61,7 @@ export class BrowserInitService extends InitService {
metadata,
breadcrumbsService,
klaroService,
themeService,
);
}
@@ -83,6 +86,7 @@ export class BrowserInitService extends InitService {
this.initI18n();
this.initAnalytics();
this.initRouteListeners();
this.themeService.listenForThemeChanges(true);
this.trackAuthTokenExpiration();
this.initKlaro();