fix: fix OCPP message sending promise leak
[e-mobility-charging-stations-simulator.git] / ui / web / src / composables / UIClient.ts
index 89db2302c81e1dec901965efeb4c6444196a5d30..b78d6a0b7fc2ed9dd41d09509ee26c953ac3114e 100644 (file)
@@ -144,9 +144,8 @@ export class UIClient {
     command: ProcedureName,
     data: RequestPayload,
   ): Promise<ResponsePayload> {
-    let uuid: string;
     return new Promise<ResponsePayload>((resolve, reject) => {
-      uuid = crypto.randomUUID();
+      const uuid = crypto.randomUUID();
       const msg = JSON.stringify([uuid, command, data]);
 
       if (this.ws.readyState !== WebSocket.OPEN) {