]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
fix(ui-web): force toggle button re-mount on navigation back to main view
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 17 Apr 2026 14:50:18 +0000 (16:50 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 17 Apr 2026 14:50:18 +0000 (16:50 +0200)
resetToggleButtonState() only cleared localStorage but never triggered
ToggleButton re-mount, leaving its reactive state stuck on 'active'.
Watch route changes to CHARGING_STATIONS and call refresh() to re-mount
both the header toggle and CSTable children, ensuring all shared toggle
buttons re-read their (now cleared) localStorage entries.

ui/web/src/views/ChargingStationsView.vue

index cf58325027f8aa38b0a10fe494ec4d9c0ca66c47..7e972d0b19807a194cf7dc14acdaafc5ba557c81 100644 (file)
@@ -129,6 +129,12 @@ watch($chargingStations, () => {
   state.value.renderChargingStations = randomUUID()
 })
 
+watch($route, to => {
+  if (to.name === ROUTE_NAMES.CHARGING_STATIONS) {
+    refresh()
+  }
+})
+
 const clearTemplates = (): void => {
   $templates.value = []
 }