From b9d572ab64e1e717f6aa1e590a5c676e6e7d70c5 Mon Sep 17 00:00:00 2001 From: Stelios Manousopoulos Date: Wed, 27 Sep 2017 13:53:35 +0300 Subject: [PATCH] water iq widget fix when best/worst months are the same --- lib/utils/widgets.js | 2 +- utils/widgets.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utils/widgets.js b/lib/utils/widgets.js index f5e961f..663a34c 100644 --- a/lib/utils/widgets.js +++ b/lib/utils/widgets.js @@ -626,7 +626,7 @@ var waterIQ = function waterIQ(widget, intl) { value: worst.user, month: intl.formatDate(worst.timestamp, { month: 'long' }) }), - display: hasWaterIQ + display: hasWaterIQ && worst.user !== best.user }, { text: intl.formatMessage({ id: 'comparisons.wateriq-no-data' }), display: !hasWaterIQ diff --git a/utils/widgets.js b/utils/widgets.js index fe1eec8..3573914 100644 --- a/utils/widgets.js +++ b/utils/widgets.js @@ -514,7 +514,7 @@ const waterIQ = function (widget, intl) { value: worst.user, month: intl.formatDate(worst.timestamp, { month: 'long' }), }), - display: hasWaterIQ, + display: hasWaterIQ && worst.user !== best.user, }, { text: intl.formatMessage({ id: 'comparisons.wateriq-no-data' }),