- // Don't save projects in cookies (too big!)
- const cfg = Object.assign({}, this.confStore);
- this.cookie.putObject('xds-config', cfg);
+ // Load initial config and apply it
+ this.load();
+ this.themeService.changeTheme(this.confStore.theme);
+ }
+
+ // Load config
+ load() {
+ // Try to retrieve previous config from cookie
+ const cookConf = this.cookie.getObject('xds-config');
+ if (cookConf != null) {
+ this.confStore = <IConfig>cookConf;
+ this.confSubject.next(Object.assign({}, this.confStore));
+ } else {
+ // Set default config
+ this.confStore = this.confDefault;
+ this.save();