From 8924c5e209350a6ea1d601979ee59457f12a4da0 Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Fri, 8 Jul 2022 18:41:41 +0300 Subject: [PATCH] Update dashboard-layout.component.ts --- .../dashboard-page/layout/dashboard-layout.component.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/dashboard-layout.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/dashboard-layout.component.ts index a4bef1fc21..c331578e2b 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/dashboard-layout.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/dashboard-layout.component.ts @@ -27,7 +27,7 @@ import { IDashboardComponent, WidgetContextMenuItem } from '@home/models/dashboard-component.models'; -import { merge, Subscription } from 'rxjs'; +import { Subscription } from 'rxjs'; import { Hotkey } from 'angular2-hotkeys'; import { TranslateService } from '@ngx-translate/core'; import { ItemBufferService } from '@app/core/services/item-buffer.service'; @@ -94,11 +94,8 @@ export class DashboardLayoutComponent extends PageComponent implements ILayoutCo } ngOnInit(): void { - const dashboardTimewindowChanged = [this.dashboard.dashboardTimewindowChanged]; - if (this.parentDashboard) { - dashboardTimewindowChanged.push(this.parentDashboard.dashboardTimewindowChanged); - } - this.rxSubscriptions.push(merge(...dashboardTimewindowChanged).subscribe( + const dashboardTimewindowChanged = this.parentDashboard ? this.parentDashboard.dashboardTimewindowChanged : this.dashboard.dashboardTimewindowChanged; + this.rxSubscriptions.push(dashboardTimewindowChanged.subscribe( (dashboardTimewindow) => { this.dashboardCtx.dashboardTimewindow = dashboardTimewindow; this.dashboardCtx.runChangeDetection();