From f6cb17676bcd54d2aa28fe9f0eaa8797ac616873 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 7 Mar 2024 15:06:31 +0100 Subject: [PATCH] refactor(ui): use watchers to refresh display MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/Bootstrap.ts | 5 ++ .../actions/AddChargingStations.vue | 12 +++-- ui/web/src/views/ChargingStationsView.vue | 54 ++++++++++--------- 3 files changed, 44 insertions(+), 27 deletions(-) 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 @@