X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FUIServiceWorkerBroadcastChannel.ts;h=3a21bc7378d71161da31480e9b7e9a3d36ada4bc;hb=3ce0201e969c813052452540075b65985b3bc47e;hp=8528c0e247002a3f830d5f777e5f488f93cda99a;hpb=857d8dd995425597a2bfb15d49e7ee6d69b055bd;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/UIServiceWorkerBroadcastChannel.ts b/src/charging-station/UIServiceWorkerBroadcastChannel.ts index 8528c0e2..3a21bc73 100644 --- a/src/charging-station/UIServiceWorkerBroadcastChannel.ts +++ b/src/charging-station/UIServiceWorkerBroadcastChannel.ts @@ -70,31 +70,31 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel { status: responsesStatus, hashIdsSucceeded: this.responses .get(uuid) - ?.responses.map(({ status, hashId }) => { + ?.responses.filter(({ hashId }) => hashId !== undefined) + .map(({ status, hashId }) => { if (status === ResponseStatus.SUCCESS) { return hashId; } - }) - .filter((hashId) => hashId !== undefined), + }), ...(responsesStatus === ResponseStatus.FAILURE && { hashIdsFailed: this.responses .get(uuid) - ?.responses.map(({ status, hashId }) => { + ?.responses.filter(({ hashId }) => hashId !== undefined) + .map(({ status, hashId }) => { if (status === ResponseStatus.FAILURE) { return hashId; } - }) - .filter((hashId) => hashId !== undefined), + }), }), ...(responsesStatus === ResponseStatus.FAILURE && { responsesFailed: this.responses .get(uuid) - ?.responses.map((response) => { + ?.responses.filter((response) => response !== undefined) + .map((response) => { if (response.status === ResponseStatus.FAILURE) { return response; } - }) - .filter((response) => response !== undefined), + }), }), }; }