From f7eb87f99e18f9b26079917eaf47b252cf57dbe6 Mon Sep 17 00:00:00 2001 From: Steven Guiheux Date: Mon, 24 Jun 2019 14:42:06 +0200 Subject: [PATCH] fix toolbar --- .../views/home/heatmap/home.heatmap.component.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ui/src/app/views/home/heatmap/home.heatmap.component.ts b/ui/src/app/views/home/heatmap/home.heatmap.component.ts index 9d5bbca5c8..b36136a676 100644 --- a/ui/src/app/views/home/heatmap/home.heatmap.component.ts +++ b/ui/src/app/views/home/heatmap/home.heatmap.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; +import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { AppService } from 'app/app.service'; import { AuthentificationStore } from 'app/service/services.module'; @@ -19,7 +19,7 @@ import { ToolbarComponent } from './toolbar/toolbar.component'; styleUrls: ['./home.heatmap.scss'] }) @AutoUnsubscribe() -export class HomeHeatmapComponent implements OnInit { +export class HomeHeatmapComponent implements OnInit, AfterViewInit { loading = true; events: Array; @@ -58,10 +58,7 @@ export class HomeHeatmapComponent implements OnInit { this.filter = new TimelineFilter(); } - ngOnInit(): void { - if (!this._authStore.isConnected) { - return; - } + ngAfterViewInit() { this.filterSub = this._timelineStore.getFilter().subscribe(f => { this.filter = f; this._appService.initFilter(this.filter); @@ -137,6 +134,12 @@ export class HomeHeatmapComponent implements OnInit { }); } }); + + } + ngOnInit(): void { + if (!this._authStore.isConnected) { + return; + } } /**