aboutsummaryrefslogtreecommitdiffstats
path: root/webapp/src/app/@core-xds/services/config.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/src/app/@core-xds/services/config.service.ts')
-rw-r--r--webapp/src/app/@core-xds/services/config.service.ts11
1 files changed, 4 insertions, 7 deletions
diff --git a/webapp/src/app/@core-xds/services/config.service.ts b/webapp/src/app/@core-xds/services/config.service.ts
index beeeea8..23a9593 100644
--- a/webapp/src/app/@core-xds/services/config.service.ts
+++ b/webapp/src/app/@core-xds/services/config.service.ts
@@ -57,7 +57,7 @@ export class ConfigService {
}
if (tm.name !== this.confStore.theme) {
this.confStore.theme = tm.name;
- this.save();
+ this.save(this.confStore);
}
});
@@ -75,16 +75,13 @@ export class ConfigService {
this.confSubject.next(Object.assign({}, this.confStore));
} else {
// Set default config
- this.confStore = this.confDefault;
- this.save();
+ this.save(null);
}
}
// Save config into cookie
- save(cfg?: IConfig) {
- if (typeof cfg !== 'undefined') {
- this.confStore = this.confDefault;
- }
+ save(cfg: IConfig | null) {
+ this.confStore = (cfg !== null) ? cfg : this.confDefault;
// Notify subscribers
this.confSubject.next(Object.assign({}, this.confStore));