Cleanup logic code flow.
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 1 Feb 2021 15:35:52 +0000 (16:35 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 1 Feb 2021 15:35:52 +0000 (16:35 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index a19ad3b4948c827223bb4472714e1b1aa4bf407b..a7081aa97eb68c74bc5522a557276972062fdd15 100644 (file)
@@ -460,8 +460,7 @@ export default class ChargingStation {
           await Utils.sleep(this.bootNotificationResponse?.interval ? this.bootNotificationResponse.interval * 1000 : Constants.OCPP_DEFAULT_BOOT_NOTIFICATION_INTERVAL);
         }
       } while (!this.isRegistered() && (registrationRetryCount <= this.getRegistrationMaxRetries() || this.getRegistrationMaxRetries() === -1));
-    }
-    if (this.isRegistered()) {
+    } else if (this.isRegistered()) {
       await this.startMessageSequence();
       this.hasStopped && (this.hasStopped = false);
       if (this.hasSocketRestarted && this.isWebSocketOpen()) {