Browse Source

Update dynamic-layout.component.ts

pull/19413/head
Masum ULU 3 years ago
committed by GitHub
parent
commit
ecb1f80ae8
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 23
      npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts

23
npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts

@ -33,18 +33,6 @@ export class DynamicLayoutComponent implements OnInit {
protected readonly routerEvents = inject(RouterEvents); protected readonly routerEvents = inject(RouterEvents);
protected readonly environment = inject(EnvironmentService); protected readonly environment = inject(EnvironmentService);
ngOnInit(): void {
if (this.layout) {
return;
}
const { oAuthConfig } = this.environment.getEnvironment() || {};
if (oAuthConfig.responseType && oAuthConfig.responseType === 'code') {
this.getLayout();
}
}
constructor(@Optional() @SkipSelf() dynamicLayoutComponent: DynamicLayoutComponent) { constructor(@Optional() @SkipSelf() dynamicLayoutComponent: DynamicLayoutComponent) {
if (dynamicLayoutComponent) { if (dynamicLayoutComponent) {
if (isDevMode()) console.warn('DynamicLayoutComponent must be used only in AppComponent.'); if (isDevMode()) console.warn('DynamicLayoutComponent must be used only in AppComponent.');
@ -53,6 +41,17 @@ export class DynamicLayoutComponent implements OnInit {
this.checkLayoutOnNavigationEnd(); this.checkLayoutOnNavigationEnd();
this.listenToLanguageChange(); this.listenToLanguageChange();
} }
ngOnInit(): void {
if (this.layout) {
return;
}
const { oAuthConfig } = this.environment.getEnvironment();
if (oAuthConfig.responseType === 'code') {
this.getLayout();
}
}
private checkLayoutOnNavigationEnd() { private checkLayoutOnNavigationEnd() {
const navigationEnd$ = this.routerEvents.getNavigationEvents('End'); const navigationEnd$ = this.routerEvents.getNavigationEvents('End');

Loading…
Cancel
Save