fix: resolve promise on charging station events once
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 17 Dec 2023 20:23:12 +0000 (21:23 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 17 Dec 2023 20:23:12 +0000 (21:23 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/Helpers.ts

index 492d26aa10dbeb5a5d028e1a7d6d111c291ac368..4f34fe180a33b01714466c4fb3cc792335863965 100644 (file)
@@ -649,6 +649,7 @@ export const waitChargingStationEvents = async (
     let events = 0;
     if (eventsToWait === 0) {
       resolve(events);
+      return;
     }
     emitter.on(event, () => {
       ++events;