From 2c2a1d204b03d003592db4b7d0d381a1456b2a07 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 13 May 2020 12:05:03 +0200 Subject: [PATCH] Graph history fix (#5846) --- .../header-footer/hui-graph-header-footer.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/panels/lovelace/header-footer/hui-graph-header-footer.ts b/src/panels/lovelace/header-footer/hui-graph-header-footer.ts index 0d0c04422f..b73be70176 100644 --- a/src/panels/lovelace/header-footer/hui-graph-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-graph-header-footer.ts @@ -75,7 +75,7 @@ export class HuiGraphHeaderFooter extends LitElement `; } - if (this._coordinates.length < 1) { + if (!this._coordinates.length) { return html`
@@ -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;