refactor(ui): cleanup UI client instance getter
[e-mobility-charging-stations-simulator.git] / ui / web / src / components / charging-stations / CSConnector.vue
index 36bb971f6c3e0316a3432643aedb4b9463a26e6a..b75fc782a6d038ae5d121969f6a70ef0c0adfe49 100644 (file)
 </template>
 
 <script setup lang="ts">
-import { getCurrentInstance } from 'vue'
 import { useToast } from 'vue-toast-notification'
 import Button from '@/components/buttons/Button.vue'
 import type { ConnectorStatus, Status } from '@/types'
 import ToggleButton from '@/components/buttons/ToggleButton.vue'
+import { useUIClient } from '@/composables'
 
 const props = defineProps<{
   hashId: string
@@ -57,7 +57,7 @@ const props = defineProps<{
 
 const $emit = defineEmits(['need-refresh'])
 
-const uiClient = getCurrentInstance()?.appContext.config.globalProperties.$uiClient
+const uiClient = useUIClient()
 
 const $toast = useToast()