summaryrefslogtreecommitdiffstats
path: root/webapp/src/app/build/build.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/src/app/build/build.component.ts')
-rw-r--r--webapp/src/app/build/build.component.ts16
1 files changed, 12 insertions, 4 deletions
diff --git a/webapp/src/app/build/build.component.ts b/webapp/src/app/build/build.component.ts
index e1076c5..a1a965b 100644
--- a/webapp/src/app/build/build.component.ts
+++ b/webapp/src/app/build/build.component.ts
@@ -44,9 +44,13 @@ export class BuildComponent implements OnInit, AfterViewChecked {
ngOnInit() {
this.config$ = this.configSvr.conf;
this.config$.subscribe((cfg) => {
- this.curProject = cfg.projects[0];
-
- this.confValid = (cfg.projects.length && this.curProject.id != null);
+ if ("projects" in cfg) {
+ this.curProject = cfg.projects[0];
+ this.confValid = (cfg.projects.length && this.curProject.id != null);
+ } else {
+ this.curProject = null;
+ this.confValid = false;
+ }
});
// Command output data tunneling
@@ -78,6 +82,10 @@ export class BuildComponent implements OnInit, AfterViewChecked {
}
make(args: string) {
+ if (!this.curProject) {
+ this.alertSvr.warning('No active project', true);
+ }
+
let prjID = this.curProject.id;
this.cmdOutput += this._outputHeader();
@@ -91,7 +99,7 @@ export class BuildComponent implements OnInit, AfterViewChecked {
},
err => {
this.cmdInfo = 'Last command duration: ' + this._computeTime(t0);
- this.alertSvr.add({ type: "danger", msg: 'ERROR: ' + err });
+ this.alertSvr.error('ERROR: ' + err);
});
}