diff options
Diffstat (limited to 'webapp/src/app/devel/devel.component.ts')
-rw-r--r-- | webapp/src/app/devel/devel.component.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/webapp/src/app/devel/devel.component.ts b/webapp/src/app/devel/devel.component.ts index ff12127..f40f25f 100644 --- a/webapp/src/app/devel/devel.component.ts +++ b/webapp/src/app/devel/devel.component.ts @@ -22,11 +22,14 @@ export class DevelComponent { ngOnInit() { this.config$ = this.configSvr.conf; this.config$.subscribe((cfg) => { - if ("projects" in cfg) { + // Select project if no one is selected or no project exists + if (this.curPrj && "id" in this.curPrj) { + this.curPrj = cfg.projects.find(p => p.id === this.curPrj.id) || cfg.projects[0]; + } else if (this.curPrj == null && "projects" in cfg) { this.curPrj = cfg.projects[0]; } else { this.curPrj = null; } }); } -}
\ No newline at end of file +} |