Skip to content

Commit

Permalink
Merge f7f8904 into d392b2e
Browse files Browse the repository at this point in the history
  • Loading branch information
ogix authored Aug 20, 2021
2 parents d392b2e + f7f8904 commit 82910a4
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions components/table/src/table/table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ export class NzTableComponent<T> implements OnInit, OnDestroy, OnChanges, AfterV
hasFixRight = false;
showPagination = true;
private destroy$ = new Subject<void>();
private loading$ = new BehaviorSubject<boolean>(false);
private templateMode$ = new BehaviorSubject<boolean>(false);
dir: Direction = 'ltr';
@ContentChild(NzTableVirtualScrollDirective, { static: false })
Expand Down Expand Up @@ -285,9 +284,9 @@ export class NzTableComponent<T> implements OnInit, OnDestroy, OnChanges, AfterV
this.cdr.markForCheck();
});

combineLatest([total$, this.loading$, this.templateMode$])
combineLatest([total$, this.templateMode$])
.pipe(
map(([total, loading, templateMode]) => total === 0 && !loading && !templateMode),
map(([total, templateMode]) => total === 0 && !templateMode),
takeUntil(this.destroy$)
)
.subscribe(empty => {
Expand All @@ -306,17 +305,8 @@ export class NzTableComponent<T> implements OnInit, OnDestroy, OnChanges, AfterV
}

ngOnChanges(changes: SimpleChanges): void {
const {
nzScroll,
nzPageIndex,
nzPageSize,
nzFrontPagination,
nzData,
nzWidthConfig,
nzNoResult,
nzLoading,
nzTemplateMode
} = changes;
const { nzScroll, nzPageIndex, nzPageSize, nzFrontPagination, nzData, nzWidthConfig, nzNoResult, nzTemplateMode } =
changes;
if (nzPageIndex) {
this.nzTableDataService.updatePageIndex(this.nzPageIndex);
}
Expand All @@ -336,9 +326,6 @@ export class NzTableComponent<T> implements OnInit, OnDestroy, OnChanges, AfterV
if (nzWidthConfig) {
this.nzTableStyleService.setTableWidthConfig(this.nzWidthConfig);
}
if (nzLoading) {
this.loading$.next(this.nzLoading);
}
if (nzTemplateMode) {
this.templateMode$.next(this.nzTemplateMode);
}
Expand Down

0 comments on commit 82910a4

Please sign in to comment.