Graph history fix (#5846)

This commit is contained in:
Bram Kragten 2020-05-13 12:05:03 +02:00 committed by GitHub
parent 581fafdcc9
commit 2c2a1d204b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,7 +75,7 @@ export class HuiGraphHeaderFooter extends LitElement
`;
}
if (this._coordinates.length < 1) {
if (!this._coordinates.length) {
return html`
<div class="container">
<div class="info">
@ -146,12 +146,13 @@ export class HuiGraphHeaderFooter extends LitElement
this._stateHistory!.push(...stateHistory[0]);
}
this._coordinates = coordinates(
this._stateHistory,
this._config!.hours_to_show!,
500,
this._config!.detail!
);
this._coordinates =
coordinates(
this._stateHistory,
this._config!.hours_to_show!,
500,
this._config!.detail!
) || [];
this._date = endTime;
this._fetching = false;