Code Review
/
src
/
xds
/
xds-agent.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fixed bug in grafana url setting
[src/xds/xds-agent.git]
/
webapp
/
src
/
app
/
@core-xds
/
services
/
config.service.ts
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
(file)
--- 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;
}
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.confSubject.next(Object.assign({}, this.confStore));
} else {
// Set default config
- this.confStore = this.confDefault;
- this.save();
+ this.save(null);
}
}
// Save config into cookie
}
}
// 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));
// Notify subscribers
this.confSubject.next(Object.assign({}, this.confStore));