mirror of
https://github.com/jwetzell/showbridge-webui.git
synced 2026-08-13 10:23:39 +00:00
load config on websocket status changes
This commit is contained in:
@@ -33,12 +33,21 @@ export class ConfigService {
|
||||
|
||||
private http = inject(HttpClient);
|
||||
private settingsService = inject(SettingsService);
|
||||
private eventsService = inject(EventsService);
|
||||
|
||||
constructor(private schemaService: SchemaService) {
|
||||
this.loadConfig();
|
||||
effect(() => {
|
||||
console.log('config state changed', this.currentlyShownConfig());
|
||||
});
|
||||
|
||||
effect(() =>{
|
||||
switch (this.eventsService.status()) {
|
||||
case 'open':
|
||||
console.log('Websocket connection opened, reloading config');
|
||||
this.loadConfig();
|
||||
break;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
loadConfig() {
|
||||
|
||||
Reference in New Issue
Block a user