import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
-import { AlertService, IAlert } from "../services/alert.service";
-import { UtilsService } from "../services/utils.service";
+import { AlertService, IAlert } from '../services/alert.service';
+import { UtilsService } from '../services/utils.service';
export interface IConfig {
+ language: string;
projectsRootDir: string;
}
private confSubject: BehaviorSubject<IConfig>;
private confStore: IConfig;
- constructor(private _window: Window,
+ constructor(
private cookie: CookieService,
private alert: AlertService,
private utils: UtilsService,
// Load config
load() {
// Try to retrieve previous config from cookie
- let cookConf = this.cookie.getObject("xds-config");
+ const cookConf = this.cookie.getObject('xds-config');
if (cookConf != null) {
this.confStore = <IConfig>cookConf;
} else {
// Set default config
this.confStore = {
- projectsRootDir: "",
- //projects: []
+ language: 'ENG',
+ projectsRootDir: '',
+ // projects: []
};
}
}
this.confSubject.next(Object.assign({}, this.confStore));
// Don't save projects in cookies (too big!)
- let cfg = Object.assign({}, this.confStore);
- this.cookie.putObject("xds-config", cfg);
+ const cfg = Object.assign({}, this.confStore);
+ this.cookie.putObject('xds-config', cfg);
}
set projectsRootDir(p: string) {