From 66edbc143c492e716320320f784ca36a520e5899 Mon Sep 17 00:00:00 2001
From: YuaFox <ruben.hormigo@linkup.cat>
Date: Fri, 2 Aug 2024 10:20:41 +0200
Subject: [PATCH] #2974 synoptic panel state not loading correctly

- Synoptic State now checks the condition when is enabled
---
 scadalts-ui/src/components/SynopticPanel/slts/State.vue | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scadalts-ui/src/components/SynopticPanel/slts/State.vue b/scadalts-ui/src/components/SynopticPanel/slts/State.vue
index 53d51d6455..08f450bf66 100644
--- a/scadalts-ui/src/components/SynopticPanel/slts/State.vue
+++ b/scadalts-ui/src/components/SynopticPanel/slts/State.vue
@@ -133,8 +133,13 @@ export default {
 
 		onPointEnabledUpdate(enabled) {
             if(enabled) {
-                this.changeComponentText(`${this.componentId}_value`, this.lastValue);
-                this.changeComponentColor(`${this.componentId}`, this.enabledColor);
+                if(this.lastValue){
+                    this.onPointValueUpdate(this.lastValue)
+                }else{
+                    // Point does not have any data
+                    this.changeComponentText(`${this.componentId}_value`, "N/A");
+                    this.changeComponentColor(`${this.componentId}`, this.enabledColor);
+                }
             } else {
                 this.changeComponentText(`${this.componentId}_value`, "N/A");
                 this.changeComponentColor(`${this.componentId}`, "#d6d5d5");