From: Jérôme Benoit Date: Mon, 19 Feb 2024 19:43:21 +0000 (+0100) Subject: fix: ensure charging stations array global property is initialized X-Git-Tag: v1.2.38~76 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=30fc5f08f040907e439a8fbedf66aa17c2100811;p=e-mobility-charging-stations-simulator.git fix: ensure charging stations array global property is initialized Signed-off-by: Jérôme Benoit --- diff --git a/ui/web/src/main.ts b/ui/web/src/main.ts index 97f0167a..d0c427bf 100644 --- a/ui/web/src/main.ts +++ b/ui/web/src/main.ts @@ -14,7 +14,11 @@ const initializeApp = (config: ConfigurationData) => { console.info('Error info:', info) // TODO: add code for UI notifications or other error handling logic } - app.config.globalProperties.$uiClient = UIClient.getInstance(config.uiServer) + app.config.globalProperties.$configuration = config + app.config.globalProperties.$chargingStations = [] + app.config.globalProperties.$uiClient = UIClient.getInstance( + app.config.globalProperties.$configuration.uiServer + ) app.config.globalProperties.$uiClient.registerWSEventListener('open', () => { app.config.globalProperties.$uiClient .listChargingStations() diff --git a/ui/web/src/views/ChargingStationsView.vue b/ui/web/src/views/ChargingStationsView.vue index 5639c991..b4f7873b 100644 --- a/ui/web/src/views/ChargingStationsView.vue +++ b/ui/web/src/views/ChargingStationsView.vue @@ -12,7 +12,7 @@ @click="loadChargingStations(() => $router.go(0))" /> - +