aboutsummaryrefslogtreecommitdiffstats
path: root/webapp/src/app/@core-xds/services
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-06-20 01:51:04 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2018-06-20 01:51:04 +0200
commitc2d621f58c1446579961bac245bc6376a02efe63 (patch)
tree5eefacf948ae01b8139b0711c6c2539fdb1d19cb /webapp/src/app/@core-xds/services
parent1d69431a4a1704566fb8a2fd1debd1f9537a1ea7 (diff)
Fixed bug in grafana url setting
Change-Id: I1e66c8a35e5b60c559c8e3e3a5e137daed2591f5 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'webapp/src/app/@core-xds/services')
-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));