potentially made it so saved settings get applied with no reload in most situations

This commit is contained in:
Isaac Grynsztein
2020-03-11 22:04:22 -04:00
parent 4f4a82c3c4
commit bad4b8630b
4 changed files with 39 additions and 11 deletions

View File

@@ -55,6 +55,20 @@ export class AppComponent implements OnInit {
}
});
this.loadConfig();
this.postsService.settings_changed.subscribe(changed => {
if (changed) {
this.loadConfig();
}
});
}
toggleSidenav() {
this.sidenav.toggle();
}
loadConfig() {
// loading config
this.postsService.loadNavItems().subscribe(res => { // loads settings
const result = !this.postsService.debugMode ? res['config_file'] : res;
@@ -71,11 +85,6 @@ export class AppComponent implements OnInit {
}, error => {
console.log(error);
});
}
toggleSidenav() {
this.sidenav.toggle();
}
// theme stuff