diff --git a/Web App/web/src/views/Charging.vue b/Web App/web/src/views/Charging.vue index f645971..bdc4689 100644 --- a/Web App/web/src/views/Charging.vue +++ b/Web App/web/src/views/Charging.vue @@ -218,6 +218,14 @@ async function loadHomeChargers() { } } +// The card shows one charger: whichever is picked in the list beside it. Until +// something is picked that is the first one — a card that says nothing until +// clicked would be a worse first impression than the charger most people have +// only one of. +const selectedHomeCharger = computed( + () => homeChargers.value.find((c) => c.id === selected.value) || homeChargers.value[0] || null +); + // A charger picked here becomes the one the control card drives. function selectHomeCharger(c) { selected.value = c.id; @@ -606,30 +614,26 @@ onMounted(async () => { -
{{ c.name }}
+{{ selectedHomeCharger.name }}