From 3eea3ebcd6172a2928aba166e26d5f06cd4dbe42 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 1 Mar 2024 16:29:20 +0100 Subject: [PATCH] refactor(ui): trivial code cleanups MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../src/components/actions/AddChargingStations.vue | 2 +- ui/web/src/components/buttons/ToggleButton.vue | 7 ------- ui/web/src/views/ChargingStationsView.vue | 12 ++++++------ 3 files changed, 7 insertions(+), 14 deletions(-) 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) }) -- 2.34.1