From cffb173f046f8d7465a0b7e0c917f6847bc90c92 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Wed, 21 Aug 2019 08:16:55 +0300 Subject: [PATCH] feature(theme-shared): stop loading process when occured nav error --- .../src/lib/components/loader-bar/loader-bar.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/loader-bar/loader-bar.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/loader-bar/loader-bar.component.ts index 30065b0b02..b6104263cb 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/loader-bar/loader-bar.component.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/loader-bar/loader-bar.component.ts @@ -1,6 +1,6 @@ import { StartLoader, StopLoader } from '@abp/ng.core'; import { Component, Input, OnDestroy } from '@angular/core'; -import { NavigationEnd, NavigationStart, Router } from '@angular/router'; +import { NavigationEnd, NavigationStart, Router, NavigationError } from '@angular/router'; import { takeUntilDestroy } from '@ngx-validate/core'; import { Actions, ofActionSuccessful } from '@ngxs/store'; import { filter } from 'rxjs/operators'; @@ -45,7 +45,10 @@ export class LoaderBarComponent implements OnDestroy { router.events .pipe( - filter(event => event instanceof NavigationStart || event instanceof NavigationEnd), + filter( + event => + event instanceof NavigationStart || event instanceof NavigationEnd || event instanceof NavigationError, + ), takeUntilDestroy(this), ) .subscribe(event => {