From d020e249e5206699107d6e63d3d585a7e72e7830 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 9 Jun 2024 16:00:35 +0200 Subject: [PATCH] fix: fix TxProfile removal with transaction id defined at Tx stop MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/Helpers.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/charging-station/Helpers.ts b/src/charging-station/Helpers.ts index 01c7f292..93df1ded 100644 --- a/src/charging-station/Helpers.ts +++ b/src/charging-station/Helpers.ts @@ -420,10 +420,11 @@ export const resetConnectorStatus = (connectorStatus: ConnectorStatus | undefine if (isNotEmptyArray(connectorStatus.chargingProfiles)) { connectorStatus.chargingProfiles = connectorStatus.chargingProfiles.filter( chargingProfile => - chargingProfile.chargingProfilePurpose !== ChargingProfilePurposeType.TX_PROFILE || - (chargingProfile.transactionId != null && + (chargingProfile.chargingProfilePurpose === ChargingProfilePurposeType.TX_PROFILE && + chargingProfile.transactionId != null && connectorStatus.transactionId != null && - chargingProfile.transactionId !== connectorStatus.transactionId) + chargingProfile.transactionId !== connectorStatus.transactionId) || + chargingProfile.chargingProfilePurpose !== ChargingProfilePurposeType.TX_PROFILE ) } resetAuthorizeConnectorStatus(connectorStatus) -- 2.34.1