- this.curPrj = this.prjSvr.getCurrent();
- this.prjSvr.Projects$.subscribe((s) => {
- if (s) {
- this.projects = s;
- if (this.curPrj === null || s.indexOf(this.curPrj) === -1) {
- this.prjSvr.setCurrent(this.curPrj = s.length ? s[0] : null);
- }
- }
- });
+ this.curPrj = this.projectSvr.getCurrent();
+ this.projects$ = this.projectSvr.projects$;
+ this.projectSvr.curProject$.subscribe(p => this.curPrj = p);