From 5fde48337e77996cc483b664ebbff5206a4f0af6 Mon Sep 17 00:00:00 2001
From: "francois.grand" <francois.grand@irstea.fr>
Date: Fri, 9 Mar 2018 15:41:04 +0100
Subject: [PATCH] =?UTF-8?q?=20#27=20FixedVarResultsComponent=20:=20r=C3=A9?=
 =?UTF-8?q?solution=20d'un=20bug=20emp=C3=AAchant=20l'affichage=20du=20jou?=
 =?UTF-8?q?rnal=20si=20aucun=20r=C3=A9sultat=20variable?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../fixedvar-results.component.ts             | 22 ++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/app/components/fixedvar-results/fixedvar-results.component.ts b/src/app/components/fixedvar-results/fixedvar-results.component.ts
index f391529fb..ee52e907b 100644
--- a/src/app/components/fixedvar-results/fixedvar-results.component.ts
+++ b/src/app/components/fixedvar-results/fixedvar-results.component.ts
@@ -40,6 +40,10 @@ export class FixedVarResultsComponent implements DoCheck {
      */
     private _doUpdate: boolean = false;
 
+    private _logUpdated: boolean = false;
+
+    private _graphUpdated: boolean = false;
+
     /**
      * composant journal
      */
@@ -65,6 +69,8 @@ export class FixedVarResultsComponent implements DoCheck {
     }
 
     public updateView() {
+        this._logUpdated = false;
+        this._graphUpdated = false;
         this.logComponent.log = undefined;
 
         if (this._results != undefined)
@@ -81,11 +87,17 @@ export class FixedVarResultsComponent implements DoCheck {
      * @returns true si les résultats ont pu être mis à jour
      */
     private updateResults() {
-        if (this._results != undefined && this.resultsGraphComponent != undefined && this.logComponent != undefined) {
-            this.resultsGraphComponent.results = this._results;
-            this.resultsGraphComponent.updateView();
-            this.logComponent.log = this._results.log;
-            return true;
+        if (this._results != undefined) {
+            if (this.resultsGraphComponent != undefined) {
+                this.resultsGraphComponent.results = this._results;
+                this.resultsGraphComponent.updateView();
+                this._graphUpdated = true;
+            }
+            if (this.logComponent != undefined) {
+                this.logComponent.log = this._results.log;
+                this._logUpdated = true;
+            }
+            return this._logUpdated && this._graphUpdated;
         }
         return false;
     }
-- 
GitLab