diff --git a/src/app/pages/accounts/accounts.component.ts b/src/app/pages/accounts/accounts.component.ts index b3f6307..ab944b1 100644 --- a/src/app/pages/accounts/accounts.component.ts +++ b/src/app/pages/accounts/accounts.component.ts @@ -40,7 +40,6 @@ export class AccountsComponent implements OnInit { this.userService.accountsSubject.subscribe(accounts => { this.dataSource = new MatTableDataSource(accounts); this.dataSource.paginator = this.paginator; - this.paginator._changePageSize(this.paginator.pageSize); this.dataSource.sort = this.sort; this.accounts = accounts; }); @@ -64,4 +63,12 @@ export class AccountsComponent implements OnInit { this.dataSource.data = this.accounts.filter(account => account.type === this.accountsType); } } + + refreshPaginator(): void { + if (!this.dataSource.paginator) { + this.dataSource.paginator = this.paginator; + } + + this.paginator._changePageSize(this.paginator.pageSize); + } }