Uniformize log messages format
[e-mobility-charging-stations-simulator.git] / src / charging-station / UIServiceWorkerBroadcastChannel.ts
index 5397e6906a076c28b1202dc9d59869fb640651aa..c64a7ccc2212d021189b373278ad8d5a804961bc 100644 (file)
@@ -1,3 +1,4 @@
+import type { ResponsePayload } from '../types/UIProtocol';
 import type { BroadcastChannelResponse, MessageEvent } from '../types/WorkerBroadcastChannel';
 import logger from '../utils/Logger';
 import type AbstractUIService from './ui-server/ui-services/AbstractUIService';
@@ -21,8 +22,10 @@ export default class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChan
     }
     this.validateMessageEvent(messageEvent);
     const [uuid, responsePayload] = messageEvent.data as BroadcastChannelResponse;
+    // TODO: handle multiple responses for the same uuid
+    delete responsePayload.hashId;
 
-    this.uiService.sendResponse(uuid, responsePayload);
+    this.uiService.sendResponse(uuid, responsePayload as ResponsePayload);
   }
 
   private messageErrorHandler(messageEvent: MessageEvent): void {