From: Jérôme Benoit Date: Thu, 7 Mar 2024 14:06:31 +0000 (+0100) Subject: refactor(ui): use watchers to refresh display X-Git-Tag: v1.3.0~34 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f6cb17676bcd54d2aa28fe9f0eaa8797ac616873;p=e-mobility-charging-stations-simulator.git refactor(ui): use watchers to refresh display Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 0c1eeeec..80470d00 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -537,6 +537,11 @@ export class Bootstrap extends EventEmitter { templateFile: string, options?: ChargingStationOptions ): Promise { + 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( diff --git a/ui/web/src/components/actions/AddChargingStations.vue b/ui/web/src/components/actions/AddChargingStations.vue index 2cac1322..f638232b 100644 --- a/ui/web/src/components/actions/AddChargingStations.vue +++ b/ui/web/src/components/actions/AddChargingStations.vue @@ -1,7 +1,7 @@