Skip to content

Commit ebc0d9d

Browse files
committed
fix(core): Only console.log error in dev mode
1 parent 9dfaa92 commit ebc0d9d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

projects/ngqp/core/src/lib/directives/query-param-group.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Inject, Injectable, OnDestroy, Optional } from '@angular/core';
1+
import { Inject, Injectable, isDevMode, OnDestroy, Optional } from '@angular/core';
22
import { Params } from '@angular/router';
33
import { EMPTY, from, Observable, Subject } from 'rxjs';
44
import { catchError, concatMap, debounceTime, map, takeUntil, tap } from 'rxjs/operators';
@@ -176,7 +176,10 @@ export class QueryParamGroupService implements OnDestroy {
176176
private navigateSafely(params: Params): Observable<any> {
177177
return from(this.routerAdapter.navigate(params, this.routerOptions)).pipe(
178178
catchError((err: any) => {
179-
console.error(`There was an error while navigating`, err);
179+
if (isDevMode()) {
180+
console.error(`There was an error while navigating`, err);
181+
}
182+
180183
return EMPTY;
181184
})
182185
);

0 commit comments

Comments
 (0)