Use 'ResolveEnd' to reset the config. Closes #101

This commit is contained in:
sercan 2018-11-27 10:44:11 +03:00
parent 8e4e4bf401
commit 6db86a6b25

View File

@ -1,5 +1,5 @@
import { Inject, Injectable, InjectionToken } from '@angular/core'; import { Inject, Injectable, InjectionToken } from '@angular/core';
import { Router, RoutesRecognized } from '@angular/router'; import { NavigationEnd, NavigationStart, ResolveEnd, Router, RoutesRecognized } from '@angular/router';
import { Platform } from '@angular/cdk/platform'; import { Platform } from '@angular/cdk/platform';
import { BehaviorSubject, Observable } from 'rxjs'; import { BehaviorSubject, Observable } from 'rxjs';
import { filter } from 'rxjs/operators'; import { filter } from 'rxjs/operators';
@ -96,7 +96,7 @@ export class FuseConfigService
// Reload the default layout config on every RoutesRecognized event // Reload the default layout config on every RoutesRecognized event
// if the current layout config is different from the default one // if the current layout config is different from the default one
this._router.events this._router.events
.pipe(filter(event => event instanceof RoutesRecognized)) .pipe(filter(event => event instanceof ResolveEnd))
.subscribe(() => { .subscribe(() => {
if ( !_.isEqual(this._configSubject.getValue().layout, this._defaultConfig.layout) ) if ( !_.isEqual(this._configSubject.getValue().layout, this._defaultConfig.layout) )
{ {