diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/alarm/alarms-table-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/alarm/alarms-table-widget.component.ts index f0a52ea923..bea4e9b6df 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/alarm/alarms-table-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/alarm/alarms-table-widget.component.ts @@ -328,18 +328,18 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit, this.updateData(); }); - this.ctx.aliasController?.filtersChanged.pipe( - takeUntil(this.destroy$) - ).subscribe((filters) => { - let currentFilterId = this.ctx.datasources?.[0]?.filterId; - if (this.displayPagination && currentFilterId && filters.includes(currentFilterId)) { - this.paginator.pageIndex = 0; - } - this.updateData(); - }); - if (this.displayPagination) { this.sort.sortChange.pipe(takeUntil(this.destroy$)).subscribe(() => this.paginator.pageIndex = 0); + + this.ctx.aliasController?.filtersChanged.pipe( + takeUntil(this.destroy$) + ).subscribe((filters) => { + let currentFilterId = this.ctx.defaultSubscription.options.alarmSource?.filterId; + if (currentFilterId && filters.includes(currentFilterId)) { + this.paginator.pageIndex = 0; + } + this.updateData(); + }); } ((this.displayPagination ? merge(this.sort.sortChange, this.paginator.page) : this.sort.sortChange) as Observable).pipe( takeUntil(this.destroy$) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/entity/entities-table-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/entity/entities-table-widget.component.ts index 0feda80f60..2420faac43 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/entity/entities-table-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/entity/entities-table-widget.component.ts @@ -263,18 +263,18 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni this.updateData(); }); - this.ctx.aliasController?.filtersChanged.pipe( - takeUntil(this.destroy$) - ).subscribe((filters) => { - let currentFilterId = this.ctx.datasources?.[0]?.filterId; - if (this.displayPagination && currentFilterId && filters.includes(currentFilterId)) { - this.paginator.pageIndex = 0; - } - this.updateData(); - }); - if (this.displayPagination) { this.sort.sortChange.pipe(takeUntil(this.destroy$)).subscribe(() => this.paginator.pageIndex = 0); + + this.ctx.aliasController?.filtersChanged.pipe( + takeUntil(this.destroy$) + ).subscribe((filters) => { + let currentFilterId = this.ctx.defaultSubscription.options.datasources?.[0]?.filterId; + if (currentFilterId && filters.includes(currentFilterId)) { + this.paginator.pageIndex = 0; + } + this.updateData(); + }); } ((this.displayPagination ? merge(this.sort.sortChange, this.paginator.page) : this.sort.sortChange) as Observable).pipe( takeUntil(this.destroy$)