X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FUIServiceWorkerBroadcastChannel.ts;h=c64a7ccc2212d021189b373278ad8d5a804961bc;hb=5cf9050d18e0fd83636ac933793848a5000b4326;hp=5397e6906a076c28b1202dc9d59869fb640651aa;hpb=6c1761d470507ea23d186be61b94ca7375c5144a;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/UIServiceWorkerBroadcastChannel.ts b/src/charging-station/UIServiceWorkerBroadcastChannel.ts index 5397e690..c64a7ccc 100644 --- a/src/charging-station/UIServiceWorkerBroadcastChannel.ts +++ b/src/charging-station/UIServiceWorkerBroadcastChannel.ts @@ -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 {