(FuseProgressBar) Hide the progress bar on NavigationCancel and NavigationError, closes #81

This commit is contained in:
Sercan Yemen 2018-07-26 10:33:23 +03:00
parent 620583f99c
commit bbd59ab6c3

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { NavigationEnd, NavigationStart, Router } from '@angular/router'; import { NavigationCancel, NavigationEnd, NavigationError, NavigationStart, Router } from '@angular/router';
import { BehaviorSubject, Observable } from 'rxjs'; import { BehaviorSubject, Observable } from 'rxjs';
import { filter } from 'rxjs/operators'; import { filter } from 'rxjs/operators';
@ -103,7 +103,7 @@ export class FuseProgressBarService
}); });
this._router.events this._router.events
.pipe(filter((event) => event instanceof NavigationEnd)) .pipe(filter((event) => event instanceof NavigationEnd || event instanceof NavigationError || event instanceof NavigationCancel))
.subscribe(() => { .subscribe(() => {
this.hide(); this.hide();
}); });