X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FUIServiceWorkerBroadcastChannel.ts;h=075a92c46249cc90a4426564c8cd0d0de64b278a;hb=69074173770c04bc5e5aa744b655edf9491daa46;hp=3a21bc7378d71161da31480e9b7e9a3d36ada4bc;hpb=3ce0201e969c813052452540075b65985b3bc47e;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/UIServiceWorkerBroadcastChannel.ts b/src/charging-station/UIServiceWorkerBroadcastChannel.ts index 3a21bc73..075a92c4 100644 --- a/src/charging-station/UIServiceWorkerBroadcastChannel.ts +++ b/src/charging-station/UIServiceWorkerBroadcastChannel.ts @@ -1,4 +1,4 @@ -import type { AbstractUIService } from './internal'; +import type { AbstractUIService } from './ui-server/ui-services/AbstractUIService'; import { WorkerBroadcastChannel } from './WorkerBroadcastChannel'; import { type BroadcastChannelResponse, @@ -7,7 +7,7 @@ import { type ResponsePayload, ResponseStatus, } from '../types'; -import { logger } from '../utils/Logger'; +import { Utils, logger } from '../utils'; const moduleName = 'UIServiceWorkerBroadcastChannel'; @@ -70,7 +70,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; @@ -79,7 +79,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; @@ -89,7 +89,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;