monkey-front-core 0.0.401 → 0.0.403

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ import { CommonModule, formatNumber, CurrencyPipe } from '@angular/common';
7
7
  import * as i1$1 from '@ngx-translate/core';
8
8
  import { TranslateModule, TranslateService } from '@ngx-translate/core';
9
9
  import * as moment_ from 'moment';
10
- import { map, catchError, filter, take, takeWhile, first, takeUntil, mergeMap, finalize } from 'rxjs/operators';
10
+ import { map, catchError, filter, takeWhile, take, first, takeUntil, mergeMap, finalize } from 'rxjs/operators';
11
11
  import { throwError, BehaviorSubject, Subscription, interval, concat, of, Subject, from } from 'rxjs';
12
12
  import * as i1$2 from '@angular/common/http';
13
13
  import { HttpParams, HttpErrorResponse, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
@@ -2720,6 +2720,7 @@ class MonkeyEcxCommonsService {
2720
2720
  this.tokenStorage = tokenStorage;
2721
2721
  this.otherArgs = otherArgs;
2722
2722
  this.flagValidator = true;
2723
+ this.destroyed = false;
2723
2724
  this.__data$ = null;
2724
2725
  this.__pagination$ = null;
2725
2726
  this.__control$ = null;
@@ -2745,25 +2746,21 @@ class MonkeyEcxCommonsService {
2745
2746
  return console.error('Method callbackPagination needs to be declared');
2746
2747
  };
2747
2748
  this.__isAbleToDoPagination = {};
2748
- this.handleInit(this);
2749
+ this.handleInit();
2749
2750
  }
2750
- handleInit(context) {
2751
+ handleInit() {
2751
2752
  if (this.otherArgs?.router) {
2752
- console.log('veio router');
2753
2753
  const { clearOnChangeRoute } = this.otherArgs?.schedule?.options || {
2754
2754
  clearOnChangeRoute: false
2755
2755
  };
2756
2756
  this.otherArgs.router.events
2757
2757
  .pipe(filter((event) => {
2758
2758
  return event instanceof NavigationStart;
2759
- }), take(1))
2759
+ }), takeWhile(() => {
2760
+ return !this.destroyed;
2761
+ }))
2760
2762
  .subscribe(() => {
2761
- console.log('veio destruir o schedule');
2762
- console.log(context);
2763
- console.log(this.__schedule);
2764
- console.log(clearOnChangeRoute);
2765
2763
  if (this.__schedule && clearOnChangeRoute) {
2766
- console.log('destruiu o schedule');
2767
2764
  this.otherArgs?.schedule?.service?.removeSchedule(this.__schedule);
2768
2765
  this.__schedule = null;
2769
2766
  }
@@ -2884,6 +2881,7 @@ class MonkeyEcxCommonsService {
2884
2881
  this.__error = null;
2885
2882
  this.__handledError = null;
2886
2883
  this.flagValidator = false;
2884
+ this.destroyed = true;
2887
2885
  }
2888
2886
  resolve(route, state, otherArgs) {
2889
2887
  if (JSON.stringify(route?.queryParams) === '{}') {