From: Jérôme Benoit Date: Thu, 15 Feb 2024 11:03:25 +0000 (+0100) Subject: refactor(ui): trivial code cleanup X-Git-Tag: v1.2.37~46 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=2113b3c6c96d48ec565fef586149f112082c6c0e;p=e-mobility-charging-stations-simulator.git refactor(ui): trivial code cleanup Signed-off-by: Jérôme Benoit --- diff --git a/ui/web/src/views/ChargingStationsView.vue b/ui/web/src/views/ChargingStationsView.vue index be7aefbe..9243b98f 100644 --- a/ui/web/src/views/ChargingStationsView.vue +++ b/ui/web/src/views/ChargingStationsView.vue @@ -42,12 +42,12 @@ const state: State = reactive({ }) async function load(): Promise { - if (state.isLoading === true) return - state.isLoading = true - const listChargingStationsPayload = await UIClient.listChargingStations() - state.chargingStations = - listChargingStationsPayload.chargingStations as unknown as ChargingStationData[] - state.isLoading = false + if (state.isLoading === false) { + state.isLoading = true + state.chargingStations = (await UIClient.listChargingStations()) + .chargingStations as ChargingStationData[] + state.isLoading = false + } } function startSimulator(): void {