Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix second visit to history panel #1835

Merged
merged 1 commit into from
Oct 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions src/data/ha-state-history-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
];
}

Expand All @@ -167,8 +167,7 @@ class HaStateHistoryData extends LocalizeMixin(PolymerElement) {
this.startTime,
this.endTime,
this.cacheConfig,
this.localize,
this.hass.language
this.localize
);
}

Expand All @@ -188,8 +187,7 @@ class HaStateHistoryData extends LocalizeMixin(PolymerElement) {
this.startTime,
this.endTime,
this.cacheConfig,
this.localize,
this.hass.language
this.localize
);
}
}
Expand All @@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this being set anywhere else? If not then does it make sense to use it in hassChanged

if (!this.hass) {
return;
}
if (cacheConfig && !cacheConfig.cacheKey) {
return;
}
if (!localize) {
return;
}
const language = this.hass.language;
let data;

if (filterType === "date") {
Expand Down