Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/panels/logbook/ha-logbook-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ class HaLogbookData extends PolymerElement {

this._setIsLoading(true);

this.getDate(this.filterDate, this.filterPeriod, this.filterEntity).then(
this.getData(this.filterDate, this.filterPeriod, this.filterEntity).then(
(logbookEntries) => {
this._setEntries(logbookEntries);
this._setIsLoading(false);
}
);
}

getDate(date, period, entityId) {
getData(date, period, entityId) {
if (!entityId) entityId = ALL_ENTITIES;

if (!DATA_CACHE[period]) DATA_CACHE[period] = [];
Expand Down
15 changes: 5 additions & 10 deletions src/panels/logbook/ha-logbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,14 @@ class HaLogbook extends LitElement {
// @ts-ignore
private _rtl = false;

protected updated(changedProps: PropertyValues) {
super.updated(changedProps);
if (!changedProps.has("hass")) {
return;
}
protected shouldUpdate(changedProps: PropertyValues) {
const oldHass = changedProps.get("hass") as HomeAssistant | undefined;
if (oldHass && oldHass.language !== this.hass.language) {
this._rtl = computeRTL(this.hass);
}
const languageChanged =
oldHass === undefined || oldHass.language !== this.hass.language;
return changedProps.has("entries") || languageChanged;
}

protected firstUpdated(changedProps: PropertyValues) {
super.firstUpdated(changedProps);
protected updated(_changedProps: PropertyValues) {
this._rtl = computeRTL(this.hass);
Comment thread
KapJI marked this conversation as resolved.
Comment thread
balloob marked this conversation as resolved.
}

Expand Down