Refactor ProcessManagerService initialization in IdeComponent

This commit is contained in:
Kristóf Tóth 2018-05-17 16:01:58 +02:00
parent 454507615d
commit 5d0fb1ab19

View File

@ -61,12 +61,7 @@ export class IdeComponent implements OnInit {
this.webSocketService.connect();
this.subscribeWS();
this.requestCode();
this.processManagerService.init();
this.processManagerService.subscribeCallback(config.ide.deployProcessName, (event) => {
this.setDeployButtonState('DEPLOYED');
this.deploymentNotificationService.deploying.next(false);
});
this.processManagerService.subscribeErrorCallback(config.ide.deployProcessName, (event) => { this.setDeployButtonState('FAILED'); });
this.initProcessManagerService();
this.resetAutoSaveCountdown();
}
@ -77,6 +72,15 @@ export class IdeComponent implements OnInit {
});
}
initProcessManagerService() {
this.processManagerService.init();
this.processManagerService.subscribeCallback(config.ide.deployProcessName, (event) => {
this.setDeployButtonState('DEPLOYED');
this.deploymentNotificationService.deploying.next(false);
});
this.processManagerService.subscribeErrorCallback(config.ide.deployProcessName, (event) => { this.setDeployButtonState('FAILED'); });
}
updateFileData(data: SourceCode) {
this.filename = data.filename;
this.directory = data.directory;