refactor(ui): cleanup helper namespace
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 1 Mar 2024 22:16:54 +0000 (23:16 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 1 Mar 2024 22:16:54 +0000 (23:16 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
ui/web/src/composables/Utils.ts
ui/web/src/composables/index.ts
ui/web/src/views/ChargingStationsView.vue

index 8cd068b3dbdd2f46e074121287d4b279a534b52b..467760535c6f5ec88cc1c58949a5c267743806f7 100644 (file)
@@ -42,7 +42,7 @@ export const getFromLocalStorage = <T>(key: string, defaultValue: T): T => {
   return item != null ? (JSON.parse(item) as T) : defaultValue
 }
 
-export const removeFromLocalStorage = (key: string): void => {
+export const deleteFromLocalStorage = (key: string): void => {
   localStorage.removeItem(key)
 }
 
index 278b82b419ff7a0124c572d72323ab5065823b3b..55c28448049250b77ab88421a7d033707735d25c 100644 (file)
@@ -2,9 +2,9 @@ export { UIClient } from './UIClient'
 export {
   convertToBoolean,
   convertToInt,
+  deleteFromLocalStorage,
   getFromLocalStorage,
   getLocalStorage,
   randomUUID,
-  removeFromLocalStorage,
   setToLocalStorage
 } from './Utils'
index 8e7611e76033a167a36b4cf1caf9b177633cb251..1babefbae8a82154757d5c1e942b086181124184 100644 (file)
@@ -119,10 +119,10 @@ import type { ResponsePayload, UIServerConfigurationSection } from '@/types'
 import Container from '@/components/Container.vue'
 import ReloadButton from '@/components/buttons/ReloadButton.vue'
 import {
+  deleteFromLocalStorage,
   getFromLocalStorage,
   getLocalStorage,
   randomUUID,
-  removeFromLocalStorage,
   setToLocalStorage
 } from '@/composables'
 import ToggleButton from '@/components/buttons/ToggleButton.vue'
@@ -147,7 +147,7 @@ const app = getCurrentInstance()
 const clearToggleButtons = (): void => {
   for (const key in getLocalStorage()) {
     if (key.includes('toggle-button')) {
-      removeFromLocalStorage(key)
+      deleteFromLocalStorage(key)
     }
   }
 }