Browse Source

Improve parent state change handling by dashboard state component

pull/5797/head
Igor Kulikov 5 years ago
parent
commit
40c2d71488
  1. 6
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-state.component.ts

6
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-state.component.ts

@ -14,7 +14,7 @@
/// limitations under the License. /// limitations under the License.
/// ///
import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit } from '@angular/core';
import { PageComponent } from '@shared/components/page.component'; import { PageComponent } from '@shared/components/page.component';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state'; import { AppState } from '@core/core.state';
@ -56,7 +56,8 @@ export class DashboardStateComponent extends PageComponent implements OnInit, On
private stateSubscription: Subscription; private stateSubscription: Subscription;
constructor(protected store: Store<AppState>) { constructor(protected store: Store<AppState>,
private cd: ChangeDetectorRef) {
super(store); super(store);
} }
@ -68,6 +69,7 @@ export class DashboardStateComponent extends PageComponent implements OnInit, On
if (this.syncParentStateParams) { if (this.syncParentStateParams) {
this.stateSubscription = this.ctx.stateController.stateChanged().subscribe(() => { this.stateSubscription = this.ctx.stateController.stateChanged().subscribe(() => {
this.updateCurrentState(); this.updateCurrentState();
this.cd.markForCheck();
}); });
} }
} }

Loading…
Cancel
Save