From: Jérôme Benoit Date: Fri, 1 Mar 2024 15:29:20 +0000 (+0100) Subject: refactor(ui): trivial code cleanups X-Git-Tag: v1.2.38~17 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=3eea3ebcd6172a2928aba166e26d5f06cd4dbe42;p=e-mobility-charging-stations-simulator.git refactor(ui): trivial code cleanups Signed-off-by: Jérôme Benoit --- diff --git a/ui/web/src/components/actions/AddChargingStations.vue b/ui/web/src/components/actions/AddChargingStations.vue index a0661a08..9c7224fb 100644 --- a/ui/web/src/components/actions/AddChargingStations.vue +++ b/ui/web/src/components/actions/AddChargingStations.vue @@ -8,7 +8,7 @@ v-for="template in app?.appContext.config.globalProperties.$templates" v-show=" Array.isArray(app?.appContext.config.globalProperties.$templates) && - app?.appContext.config.globalProperties.$templates.length > 0 + app.appContext.config.globalProperties.$templates.length > 0 " > {{ template }} diff --git a/ui/web/src/components/buttons/ToggleButton.vue b/ui/web/src/components/buttons/ToggleButton.vue index b51c8558..0c36be22 100644 --- a/ui/web/src/components/buttons/ToggleButton.vue +++ b/ui/web/src/components/buttons/ToggleButton.vue @@ -34,13 +34,6 @@ const click = (): void => { } setToLocalStorage(id, !getFromLocalStorage(id, props.status ?? false)) state.value.status = getFromLocalStorage(id, props.status ?? false) - // console.log(`----begin----`) - // for (const key in localStorage) { - // if (key.startsWith('shared-toggle-button-')) { - // console.log(key, getFromLocalStorage(key, props.status ?? false)) - // } - // } - // console.log(`----end----`) if (getFromLocalStorage(id, props.status ?? false)) { props.on?.() } else { diff --git a/ui/web/src/views/ChargingStationsView.vue b/ui/web/src/views/ChargingStationsView.vue index 7ffefe76..cbd8a34b 100644 --- a/ui/web/src/views/ChargingStationsView.vue +++ b/ui/web/src/views/ChargingStationsView.vue @@ -73,15 +73,15 @@ @@ -118,7 +118,7 @@ const clearChargingStations = (): void => { clearToggleButtons() app!.appContext.config.globalProperties.$chargingStations = [] state.value.renderAddChargingStations = randomUUID() - state.value.renderChargingStationsList = randomUUID() + state.value.renderChargingStations = randomUUID() } const initializeWSEventListeners = () => { @@ -139,7 +139,7 @@ const initializeWSEventListeners = () => { }) loadChargingStations(() => { state.value.renderAddChargingStations = randomUUID() - state.value.renderChargingStationsList = randomUUID() + state.value.renderChargingStations = randomUUID() }) }) app?.appContext.config.globalProperties.$uiClient.registerWSEventListener( @@ -158,7 +158,7 @@ onMounted(() => { const state = ref({ renderAddChargingStations: randomUUID(), - renderChargingStationsList: randomUUID(), + renderChargingStations: randomUUID(), loading: false, uiServerIndex: getFromLocalStorage('uiServerConfigurationIndex', 0) })