Refactor deployment notification init in DashboardComponent

This commit is contained in:
Kristóf Tóth 2018-05-17 16:04:30 +02:00
parent 3980051823
commit 399a970340
1 changed files with 11 additions and 7 deletions

View File

@ -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);