X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FUIServiceWorkerBroadcastChannel.ts;h=5f77b0e3450768bc79a87cacbfa744e77c3f268b;hb=100d2375df64a53c42cada02cecc815c833a44a8;hp=d9e746393d32b03f6062787a8924d819d864bf1d;hpb=2896e06dc8d72adf7150b23c941079f622f6f37c;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/UIServiceWorkerBroadcastChannel.ts b/src/charging-station/UIServiceWorkerBroadcastChannel.ts index d9e74639..5f77b0e3 100644 --- a/src/charging-station/UIServiceWorkerBroadcastChannel.ts +++ b/src/charging-station/UIServiceWorkerBroadcastChannel.ts @@ -6,7 +6,7 @@ import { type ResponsePayload, ResponseStatus, } from '../types'; -import { logger } from '../utils/Logger'; +import { Utils, logger } from '../utils'; const moduleName = 'UIServiceWorkerBroadcastChannel'; @@ -69,7 +69,7 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel { status: responsesStatus, hashIdsSucceeded: this.responses .get(uuid) - ?.responses.filter(({ hashId }) => hashId !== undefined) + ?.responses.filter(({ hashId }) => !Utils.isNullOrUndefined(hashId)) .map(({ status, hashId }) => { if (status === ResponseStatus.SUCCESS) { return hashId; @@ -78,7 +78,7 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel { ...(responsesStatus === ResponseStatus.FAILURE && { hashIdsFailed: this.responses .get(uuid) - ?.responses.filter(({ hashId }) => hashId !== undefined) + ?.responses.filter(({ hashId }) => !Utils.isNullOrUndefined(hashId)) .map(({ status, hashId }) => { if (status === ResponseStatus.FAILURE) { return hashId; @@ -88,7 +88,7 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel { ...(responsesStatus === ResponseStatus.FAILURE && { responsesFailed: this.responses .get(uuid) - ?.responses.filter((response) => response !== undefined) + ?.responses.filter((response) => !Utils.isNullOrUndefined(response)) .map((response) => { if (response.status === ResponseStatus.FAILURE) { return response;