Merge branch 'master' into develop/flex-layout

This commit is contained in:
Igor Kulikov 2024-10-18 17:54:06 +03:00
commit 261a769a57
2 changed files with 28 additions and 8 deletions

View File

@ -959,11 +959,15 @@ export class WidgetComponent extends PageComponent implements OnInit, OnChanges,
this.widgetContext.hiddenData = subscription.hiddenData; this.widgetContext.hiddenData = subscription.hiddenData;
this.widgetContext.timeWindow = subscription.timeWindow; this.widgetContext.timeWindow = subscription.timeWindow;
this.widgetContext.defaultSubscription = subscription; this.widgetContext.defaultSubscription = subscription;
this.ngZone.run(() => {
createSubscriptionSubject.next(); createSubscriptionSubject.next();
createSubscriptionSubject.complete(); createSubscriptionSubject.complete();
});
}, },
(err) => { (err) => {
this.ngZone.run(() => {
createSubscriptionSubject.error(err); createSubscriptionSubject.error(err);
});
} }
); );
} else if (this.widget.type === widgetType.rpc) { } else if (this.widget.type === widgetType.rpc) {
@ -1016,11 +1020,15 @@ export class WidgetComponent extends PageComponent implements OnInit, OnChanges,
this.createSubscription(options).subscribe( this.createSubscription(options).subscribe(
(subscription) => { (subscription) => {
this.widgetContext.defaultSubscription = subscription; this.widgetContext.defaultSubscription = subscription;
this.ngZone.run(() => {
createSubscriptionSubject.next(); createSubscriptionSubject.next();
createSubscriptionSubject.complete(); createSubscriptionSubject.complete();
});
}, },
(err) => { (err) => {
this.ngZone.run(() => {
createSubscriptionSubject.error(err); createSubscriptionSubject.error(err);
});
} }
); );
this.detectChanges(); this.detectChanges();

View File

@ -415,7 +415,13 @@ export class WidgetContext {
this.dashboardWidget.updateWidgetParams(); this.dashboardWidget.updateWidgetParams();
} }
try { try {
this.changeDetectorValue.detectChanges(); if (this.ngZone) {
this.ngZone.run(() => {
this.changeDetectorValue?.detectChanges();
});
} else {
this.changeDetectorValue?.detectChanges();
}
} catch (e) { } catch (e) {
// console.log(e); // console.log(e);
} }
@ -425,7 +431,13 @@ export class WidgetContext {
detectContainerChanges() { detectContainerChanges() {
if (!this.destroyed) { if (!this.destroyed) {
try { try {
this.containerChangeDetectorValue.detectChanges(); if (this.ngZone) {
this.ngZone.run(() => {
this.containerChangeDetectorValue?.detectChanges();
});
} else {
this.containerChangeDetectorValue?.detectChanges();
}
} catch (e) { } catch (e) {
// console.log(e); // console.log(e);
} }