From 56c298254011750a08c6be90d94c098c31f6bdc3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 27 May 2023 14:37:24 +0200 Subject: [PATCH] fix: clone ATG connector status before altering it MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/AutomaticTransactionGenerator.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index b87eaab3..477a8d9c 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -330,8 +330,9 @@ export class AutomaticTransactionGenerator extends AsyncResource { } private getConnectorStatus(connectorId: number): Status { - const connectorStatus = - this.chargingStation.getAutomaticTransactionGeneratorStatuses()[connectorId]; + const connectorStatus = Utils.cloneObject( + this.chargingStation.getAutomaticTransactionGeneratorStatuses() + )[connectorId]; delete connectorStatus?.startDate; delete connectorStatus?.lastRunDate; delete connectorStatus?.stopDate; -- 2.34.1