- // Save config into cookie
- save() {
- // Notify subscribers
- this.confSubject.next(Object.assign({}, this.confStore));
+ // Save selected theme in cookie
+ this.themeService.onThemeChange().subscribe(tm => {
+ if (typeof this.confStore === 'undefined') {
+ return;
+ }
+ if (tm.name !== this.confStore.theme) {
+ this.confStore.theme = tm.name;
+ this.save(this.confStore);
+ }
+ });