Browse Source

remove: router wait service check

pull/20804/head
sumeyyeKurtulus 2 years ago
parent
commit
0e619bfbcd
  1. 21
      npm/ng-packs/packages/theme-shared/src/lib/directives/ngx-datatable-list.directive.ts

21
npm/ng-packs/packages/theme-shared/src/lib/directives/ngx-datatable-list.directive.ts

@ -14,8 +14,7 @@ import {
} from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { DatatableComponent } from '@swimlane/ngx-datatable';
import { combineLatest } from 'rxjs';
import { ListService, LocalizationService, RouterWaitService } from '@abp/ng.core';
import { ListService, LocalizationService } from '@abp/ng.core';
import {
defaultNgxDatatableMessages,
NGX_DATATABLE_MESSAGES,
@ -34,7 +33,6 @@ export class NgxDatatableListDirective implements OnChanges, OnInit, DoCheck, Af
protected readonly destroyRef = inject(DestroyRef);
protected readonly localizationService = inject(LocalizationService);
protected readonly ngxDatatableMessages = inject(NGX_DATATABLE_MESSAGES, { optional: true });
protected readonly routerWaitService = inject(RouterWaitService);
protected readonly viewContainerRef = inject(ViewContainerRef);
protected readonly renderer = inject(Renderer2);
@ -72,16 +70,13 @@ export class NgxDatatableListDirective implements OnChanges, OnInit, DoCheck, Af
}
protected subscribeToLoadingState() {
combineLatest([this.list.isLoading$, this.routerWaitService.getLoading$()]).subscribe(
([listLoading, routerLoading]) => {
const isLoading = listLoading || routerLoading;
if (isLoading) {
this.handleLoadingStart();
} else {
this.handleLoadingStop();
}
},
);
this.list.isLoading$.subscribe(listLoading => {
if (listLoading) {
this.handleLoadingStart();
} else {
this.handleLoadingStop();
}
});
}
protected handleLoadingStop() {

Loading…
Cancel
Save