mirror of
				https://github.com/avatao-content/frontend-tutorial-framework
				synced 2025-11-04 06:12:54 +00:00 
			
		
		
		
	Refactor deployment notification init in DashboardComponent
This commit is contained in:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user