diff --git a/ui-ngx/src/app/modules/home/components/widget/widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/widget.component.ts index 9ff7f24568..8459a361e4 100644 --- a/ui-ngx/src/app/modules/home/components/widget/widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/widget.component.ts @@ -959,11 +959,15 @@ export class WidgetComponent extends PageComponent implements OnInit, OnChanges, this.widgetContext.hiddenData = subscription.hiddenData; this.widgetContext.timeWindow = subscription.timeWindow; this.widgetContext.defaultSubscription = subscription; - createSubscriptionSubject.next(); - createSubscriptionSubject.complete(); + this.ngZone.run(() => { + createSubscriptionSubject.next(); + createSubscriptionSubject.complete(); + }); }, (err) => { - createSubscriptionSubject.error(err); + this.ngZone.run(() => { + createSubscriptionSubject.error(err); + }); } ); } else if (this.widget.type === widgetType.rpc) { @@ -1016,11 +1020,15 @@ export class WidgetComponent extends PageComponent implements OnInit, OnChanges, this.createSubscription(options).subscribe( (subscription) => { this.widgetContext.defaultSubscription = subscription; - createSubscriptionSubject.next(); - createSubscriptionSubject.complete(); + this.ngZone.run(() => { + createSubscriptionSubject.next(); + createSubscriptionSubject.complete(); + }); }, (err) => { - createSubscriptionSubject.error(err); + this.ngZone.run(() => { + createSubscriptionSubject.error(err); + }); } ); this.detectChanges(); diff --git a/ui-ngx/src/app/modules/home/models/widget-component.models.ts b/ui-ngx/src/app/modules/home/models/widget-component.models.ts index 673bc21edb..9e739cafb4 100644 --- a/ui-ngx/src/app/modules/home/models/widget-component.models.ts +++ b/ui-ngx/src/app/modules/home/models/widget-component.models.ts @@ -415,7 +415,13 @@ export class WidgetContext { this.dashboardWidget.updateWidgetParams(); } try { - this.changeDetectorValue.detectChanges(); + if (this.ngZone) { + this.ngZone.run(() => { + this.changeDetectorValue?.detectChanges(); + }); + } else { + this.changeDetectorValue?.detectChanges(); + } } catch (e) { // console.log(e); } @@ -425,7 +431,13 @@ export class WidgetContext { detectContainerChanges() { if (!this.destroyed) { try { - this.containerChangeDetectorValue.detectChanges(); + if (this.ngZone) { + this.ngZone.run(() => { + this.containerChangeDetectorValue?.detectChanges(); + }); + } else { + this.containerChangeDetectorValue?.detectChanges(); + } } catch (e) { // console.log(e); }