<ReloadButton
id="reload-button"
:loading="state.loading"
- @click="loadChargingStations(() => (state.reload = randomUUID()))"
+ @click="loadChargingStations(() => (state.renderChargingStationsList = randomUUID()))"
/>
</Container>
<CSTable
Array.isArray(app?.appContext.config.globalProperties.$chargingStations) &&
app?.appContext.config.globalProperties.$chargingStations.length > 0
"
- :key="state.reload"
+ :key="state.renderChargingStationsList"
:charging-stations="app?.appContext.config.globalProperties.$chargingStations"
/>
</Container>
}
const state = reactive({
+ renderChargingStationsList: randomUUID(),
loading: false,
- reload: randomUUID(),
uiServerIndex: getFromLocalStorage<number>('uiServerConfigurationIndex', 0)
})
const $toast = useToast()
-const loadChargingStations = (reloadCallback?: () => void): void => {
+const loadChargingStations = (renderCallback?: () => void): void => {
if (state.loading === false) {
state.loading = true
uiClient
console.error('Error at fetching charging stations:', error)
})
.finally(() => {
- if (reloadCallback != null) {
- reloadCallback()
+ if (renderCallback != null) {
+ renderCallback()
}
state.loading = false
})