refactor(ui): use watchers to refresh display
[e-mobility-charging-stations-simulator.git] / src / charging-station / Bootstrap.ts
index 0c1eeeecb0386a009fba09797b02db651b15ea6e..80470d00f3e5069dcf498111f32cc8b28f009a02 100644 (file)
@@ -537,6 +537,11 @@ export class Bootstrap extends EventEmitter {
     templateFile: string,
     options?: ChargingStationOptions
   ): Promise<void> {
+    if (!this.started && !this.starting) {
+      throw new BaseError(
+        'Cannot add a charging station while charging stations simulator is not started'
+      )
+    }
     await this.workerImplementation?.addElement({
       index,
       templateFile: join(