Fixes after review

This commit is contained in:
Piotr Pekala 2019-06-12 03:01:40 -07:00
parent 3f823fac4c
commit 7a166cc69d
2 changed files with 10 additions and 2 deletions

View File

@ -49,6 +49,9 @@ export class ServersComponent implements OnInit, OnDestroy {
if(!server) {
return;
}
if(serverStatus.status === 'starting') {
server.status = 'starting';
}
if(serverStatus.status === 'stopped') {
server.status = 'stopped';
}
@ -98,7 +101,6 @@ export class ServersComponent implements OnInit, OnDestroy {
}
async startServer(server: Server) {
server.status = "starting";
await this.serverManagement.start(server);
}

View File

@ -5,7 +5,7 @@ import { Subject } from 'rxjs';
export interface ServerStateEvent {
serverName: string;
status: "started" | "errored" | "stopped" | "stderr";
status: "starting" | "started" | "errored" | "stopped" | "stderr";
message: string;
}
@ -29,6 +29,12 @@ export class ServerManagementService implements OnDestroy {
}
async start(server: Server) {
var startingEvent : ServerStateEvent = {
serverName: server.name,
status: "starting",
message: ''
};
this.serverStatusChanged.next(startingEvent);
return await this.electronService.remote.require('./local-server.js').startLocalServer(server);
}