]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
fix(ui-web): use portable WebSocketReadyState in CSData isWebSocketOpen
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 17 Apr 2026 00:58:43 +0000 (02:58 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 17 Apr 2026 00:59:23 +0000 (02:59 +0200)
Replace browser-specific WebSocket.OPEN with WebSocketReadyState.OPEN
from ui-common for environment portability.

ui/web/src/components/charging-stations/CSData.vue

index 6420c0075a05df5d016e77e6b26b010193f75eb5..1aa169d8eeba0e398273b1af4f323817488e1cfc 100644 (file)
@@ -121,6 +121,7 @@ import {
   type ConnectorEntry,
   getWebSocketStateName,
   type Status,
+  WebSocketReadyState,
 } from 'ui-common'
 import { computed } from 'vue'
 import { useToast } from 'vue-toast-notification'
@@ -143,7 +144,7 @@ const props = defineProps<{
 
 const $emit = defineEmits(['need-refresh'])
 
-const isWebSocketOpen = computed(() => props.chargingStation.wsState === WebSocket.OPEN)
+const isWebSocketOpen = computed(() => props.chargingStation.wsState === WebSocketReadyState.OPEN)
 
 const getConnectorEntries = (): ConnectorEntry[] => {
   if (Array.isArray(props.chargingStation.evses) && props.chargingStation.evses.length > 0) {