From: Jérôme Benoit Date: Tue, 27 Feb 2024 00:38:32 +0000 (+0100) Subject: refactor(ui): cleanup variables namespace X-Git-Tag: v1.2.38~35 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=86545028054a9b13982500366c51e7ea2503a4eb;p=e-mobility-charging-stations-simulator.git refactor(ui): cleanup variables namespace Signed-off-by: Jérôme Benoit --- diff --git a/ui/web/src/views/ChargingStationsView.vue b/ui/web/src/views/ChargingStationsView.vue index 18b0cc02..113137c8 100644 --- a/ui/web/src/views/ChargingStationsView.vue +++ b/ui/web/src/views/ChargingStationsView.vue @@ -44,7 +44,7 @@ 0 " - :key="state.reload" + :key="state.renderChargingStationsList" :charging-stations="app?.appContext.config.globalProperties.$chargingStations" /> @@ -73,8 +73,8 @@ const randomUUID = (): `${string}-${string}-${string}-${string}-${string}` => { } const state = reactive({ + renderChargingStationsList: randomUUID(), loading: false, - reload: randomUUID(), uiServerIndex: getFromLocalStorage('uiServerConfigurationIndex', 0) }) @@ -90,7 +90,7 @@ const uiServerConfigurations: { configuration: UIServerConfigurationSection; ind const $toast = useToast() -const loadChargingStations = (reloadCallback?: () => void): void => { +const loadChargingStations = (renderCallback?: () => void): void => { if (state.loading === false) { state.loading = true uiClient @@ -105,8 +105,8 @@ const loadChargingStations = (reloadCallback?: () => void): void => { console.error('Error at fetching charging stations:', error) }) .finally(() => { - if (reloadCallback != null) { - reloadCallback() + if (renderCallback != null) { + renderCallback() } state.loading = false })