From 8e4e1939784c644ae9cfd3f23dce1e4cf9f80ddd Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 27 Jun 2021 15:06:26 +0200 Subject: [PATCH] Fix Boostrap singleton class direct call MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/Bootstrap.ts | 2 +- src/charging-station/ChargingStation.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 97c231cb..a9e6d1ef 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -17,7 +17,7 @@ export default class Bootstrap { private constructor() { this.started = false; this.workerScript = path.join(path.resolve(__dirname, '../'), 'charging-station', 'StationWorker.js'); - Configuration.setConfigurationChangeCallback(async () => this.restart()); + Configuration.setConfigurationChangeCallback(async () => await Bootstrap.getInstance().restart()); } public static getInstance(): Bootstrap { diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 9d2b6874..4c3179f4 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -375,7 +375,7 @@ export default class ChargingStation { if (!Utils.isEmptyArray(this.getConnector(connectorId).chargingProfiles)) { this.getConnector(connectorId).chargingProfiles?.forEach((chargingProfile: ChargingProfile, index: number) => { if (chargingProfile.chargingProfileId === cp.chargingProfileId - || (chargingProfile.stackLevel === cp.stackLevel && chargingProfile.chargingProfilePurpose === cp.chargingProfilePurpose)) { + || (chargingProfile.stackLevel === cp.stackLevel && chargingProfile.chargingProfilePurpose === cp.chargingProfilePurpose)) { this.getConnector(connectorId).chargingProfiles[index] = cp; return true; } -- 2.34.1