From dc347546238a2a8c5cf9f5e1c60dac29913e3948 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 3 Aug 2023 15:39:02 +0200 Subject: [PATCH] fix: remove transaction charging profiles at stop transaction 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/charging-station/Helpers.ts b/src/charging-station/Helpers.ts index 376199bf..0384da3e 100644 --- a/src/charging-station/Helpers.ts +++ b/src/charging-station/Helpers.ts @@ -339,6 +339,11 @@ export const initializeConnectorsMapStatus = ( }; export const resetConnectorStatus = (connectorStatus: ConnectorStatus): void => { + connectorStatus.chargingProfiles = isNotEmptyArray(connectorStatus.chargingProfiles) + ? connectorStatus.chargingProfiles?.filter( + (chargingProfile) => chargingProfile.transactionId !== connectorStatus?.transactionId, + ) + : []; connectorStatus.idTagLocalAuthorized = false; connectorStatus.idTagAuthorized = false; connectorStatus.transactionRemoteStarted = false; -- 2.34.1