From 399a9703407518d0b61b97d3deb5f6fba220eea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Thu, 17 May 2018 16:04:30 +0200 Subject: [PATCH] Refactor deployment notification init in DashboardComponent --- src/app/dashboard/dashboard.component.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index 4088ef6..59cdfc1 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -30,13 +30,7 @@ export class DashboardComponent implements OnInit, OnDestroy { ngOnInit() { this.webSocketService.connect(); this.initCommandHandling(); - this.deploymentNotificationSubscription = this.deploymentNotificationService.deploying.subscribe( - (deploying) => { - this.deploying = deploying; - if (!deploying) { - this.reloadIframe(); - } - }); + this.initDeploymentNotifications(); } initCommandHandling() { @@ -46,6 +40,16 @@ export class DashboardComponent implements OnInit, OnDestroy { }); } + initDeploymentNotifications() { + this.deploymentNotificationSubscription = this.deploymentNotificationService.deploying.subscribe( + (deploying) => { + this.deploying = deploying; + if (!deploying) { + this.reloadIframe(); + } + }); + } + layoutHandler(data: LayoutCommand) { if (config.dashboard.enabledLayouts.includes(data.layout)) { this.setLayout(data.layout);