fix(ui): handle missing version in simulator state
[e-mobility-charging-stations-simulator.git] / ui / web / src / components / buttons / ToggleButton.vue
index dd1805ca11a1e43dde08d3bb726a018177f88b29..6d72ba10f04a3e874f63b4757b11d14dbc2ee112 100644 (file)
@@ -21,12 +21,12 @@ const $emit = defineEmits(['clicked'])
 
 const id = props.shared === true ? `shared-toggle-button-${props.id}` : `toggle-button-${props.id}`
 
-const state = ref({
+const state = ref<{ status: boolean }>({
   status: getFromLocalStorage<boolean>(id, props.status ?? false)
 })
 
 const click = (): void => {
-  if (props.shared) {
+  if (props.shared === true) {
     for (const key in localStorage) {
       if (key !== id && key.startsWith('shared-toggle-button-')) {
         setToLocalStorage<boolean>(key, false)
@@ -48,5 +48,6 @@ const click = (): void => {
 <style>
 .on {
   background-color: lightgrey;
+  border-style: inset;
 }
 </style>