fix: ensure WS connection retry flag is reset in all connection case
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 28 Jan 2024 18:42:15 +0000 (19:42 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 28 Jan 2024 18:42:15 +0000 (19:42 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index 2c683058491b713019c10472a8f5c42fe2a45a7c..5c3c13c75d6cc3bec77b2e4f8091c7081611ed65 100644 (file)
@@ -225,6 +225,9 @@ export class ChargingStation extends EventEmitter {
       })
       this.wsConnectionRetried = false
     })
+    this.on(ChargingStationEvents.rejected, () => {
+      this.wsConnectionRetried = false
+    })
     this.on(ChargingStationEvents.disconnected, () => {
       try {
         this.internalStopMessageSequence()