Browse Source

fix: add noop to catch routing errors

pull/4741/head
Arman Ozak 6 years ago
parent
commit
2c4357a99a
  1. 3
      npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts

3
npm/ng-packs/packages/core/src/lib/states/replaceable-components.state.ts

@ -1,3 +1,4 @@
import { noop } from '@abp/ng.core';
import { Injectable, NgZone } from '@angular/core'; import { Injectable, NgZone } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { Action, createSelector, Selector, State, StateContext } from '@ngxs/store'; import { Action, createSelector, Selector, State, StateContext } from '@ngxs/store';
@ -42,7 +43,7 @@ export class ReplaceableComponentsState {
this.router.navigated = false; this.router.navigated = false;
this.ngZone.run(async () => { this.ngZone.run(async () => {
await this.router.navigateByUrl(this.router.url).catch(); await this.router.navigateByUrl(this.router.url).catch(noop);
setRouteReuse(shouldReuseRoute); setRouteReuse(shouldReuseRoute);
}); });
} }

Loading…
Cancel
Save