From 962df7fe9a5be06df3c60353afd1685486c84e33 Mon Sep 17 00:00:00 2001 From: Sercan Yemen Date: Mon, 27 Aug 2018 11:50:53 +0300 Subject: [PATCH] (FuseConfig) Use RoutesRecognized event for better layout resetting especially on lazily loaded routes --- src/@fuse/services/config.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/@fuse/services/config.service.ts b/src/@fuse/services/config.service.ts index 175ee264..554910e1 100644 --- a/src/@fuse/services/config.service.ts +++ b/src/@fuse/services/config.service.ts @@ -1,5 +1,5 @@ import { Inject, Injectable, InjectionToken } from '@angular/core'; -import { NavigationStart, Router } from '@angular/router'; +import { Router, RoutesRecognized } from '@angular/router'; import { Platform } from '@angular/cdk/platform'; import { BehaviorSubject, Observable } from 'rxjs'; import { filter } from 'rxjs/operators'; @@ -93,10 +93,10 @@ export class FuseConfigService // Set the config from the default config this._configSubject = new BehaviorSubject(_.cloneDeep(this._defaultConfig)); - // Reload the default config on every navigation start if + // Reload the default config on every RoutesRecognized event if // the current config is different from the default one this._router.events - .pipe(filter(event => event instanceof NavigationStart)) + .pipe(filter(event => event instanceof RoutesRecognized)) .subscribe(() => { if ( !_.isEqual(this._configSubject.getValue(), this._defaultConfig) ) {