diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/action/action-widget.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/action/action-widget.models.ts index dbf83aac9a..9c5bc7885a 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/action/action-widget.models.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/action/action-widget.models.ts @@ -25,6 +25,7 @@ import { WidgetContext } from '@home/models/widget-component.models'; import { BehaviorSubject, forkJoin, + merge, Observable, Observer, of, @@ -33,7 +34,7 @@ import { switchMap, throwError } from 'rxjs'; -import { catchError, delay, map, share, take } from 'rxjs/operators'; +import { catchError, debounceTime, delay, map, share, take } from 'rxjs/operators'; import { AfterViewInit, ChangeDetectorRef, Directive, Input, OnDestroy, OnInit, TemplateRef } from '@angular/core'; import { DataToValueSettings, @@ -657,8 +658,15 @@ export class DashboardStateWithParamsGetter extends ValueGetter { if (this.simulated) { return of({id: 'default', params: {}}); } else { - return this.ctx.stateController.dashboardCtrl.dashboardCtx.stateId.pipe( - map(id => ({id, params: deepClone(this.ctx.stateController.getStateParams())})) + return merge( + this.ctx.stateController.dashboardCtrl.dashboardCtx.stateId, + this.ctx.stateController.dashboardCtrl.dashboardCtx.stateChanged + ).pipe( + debounceTime(10), + map(() => ({ + id: this.ctx.stateController.getStateId(), + params: deepClone(this.ctx.stateController.getStateParams()) + })) ); } }