From 4f8c8762c70925c171b9f97bfc5c468b229a1f00 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 22 Oct 2018 21:37:21 +0200 Subject: [PATCH] Fix second visit to history panel (#1835) --- src/data/ha-state-history-data.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/data/ha-state-history-data.js b/src/data/ha-state-history-data.js index a5bae88565..0e0835266f 100644 --- a/src/data/ha-state-history-data.js +++ b/src/data/ha-state-history-data.js @@ -155,7 +155,7 @@ class HaStateHistoryData extends LocalizeMixin(PolymerElement) { static get observers() { return [ - "filterChangedDebouncer(filterType, entityId, startTime, endTime, cacheConfig, localize, language)", + "filterChangedDebouncer(filterType, entityId, startTime, endTime, cacheConfig, localize)", ]; } @@ -167,8 +167,7 @@ class HaStateHistoryData extends LocalizeMixin(PolymerElement) { this.startTime, this.endTime, this.cacheConfig, - this.localize, - this.hass.language + this.localize ); } @@ -188,8 +187,7 @@ class HaStateHistoryData extends LocalizeMixin(PolymerElement) { this.startTime, this.endTime, this.cacheConfig, - this.localize, - this.hass.language + this.localize ); } } @@ -210,13 +208,18 @@ class HaStateHistoryData extends LocalizeMixin(PolymerElement) { startTime, endTime, cacheConfig, - localize, - language + localize ) { - if (!this.hass) return; - if (cacheConfig && !cacheConfig.cacheKey) return; - if (!localize || !language) return; - this._madeFirstCall = true; + if (!this.hass) { + return; + } + if (cacheConfig && !cacheConfig.cacheKey) { + return; + } + if (!localize) { + return; + } + const language = this.hass.language; let data; if (filterType === "date") {