mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2024-12-05 02:41:32 +00:00
Refactor deployment notification init in DashboardComponent
This commit is contained in:
parent
3980051823
commit
399a970340
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user