mirror of
https://github.com/jwetzell/showbridge-webui.git
synced 2026-09-07 06:19:00 +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 http = inject(HttpClient);
|
||||||
private settingsService = inject(SettingsService);
|
private settingsService = inject(SettingsService);
|
||||||
|
private eventsService = inject(EventsService);
|
||||||
|
|
||||||
constructor(private schemaService: SchemaService) {
|
constructor(private schemaService: SchemaService) {
|
||||||
this.loadConfig();
|
|
||||||
effect(() => {
|
effect(() => {
|
||||||
console.log('config state changed', this.currentlyShownConfig());
|
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() {
|
loadConfig() {
|
||||||
|
|||||||
Reference in New Issue
Block a user