# HG changeset patch # User Fadi Abbud # Date 1559742450 -7200 # Node ID c03170a1c3334025d50397b5a99f3396b197019c # Parent bcf9713ee359d305745bd7d5c5457756570d4194 client: waterlevel: check if there is prediction data before drawing the predictionarea diff -r bcf9713ee359 -r c03170a1c333 client/src/components/gauge/Waterlevel.vue --- a/client/src/components/gauge/Waterlevel.vue Wed Jun 05 14:57:44 2019 +0200 +++ b/client/src/components/gauge/Waterlevel.vue Wed Jun 05 15:47:30 2019 +0200 @@ -217,6 +217,9 @@ }-${this.dateFrom.toISOString().split("T")[0]}-${ this.dateTo.toISOString().split("T")[0] }.csv`; + }, + hasPredictions() { + return this.waterlevels.find(d => d.predicted); } }, watch: { @@ -552,7 +555,9 @@ // draw (order matters) updaters.push(this.drawAxes()); updaters.push(this.drawWaterlevelChart()); - updaters.push(this.drawPredictionAreas()); + if (this.hasPredictions) { + updaters.push(this.drawPredictionAreas()); + } updaters.push(this.drawNowLines()); // static, don't need updater