From 47d6bb69b0815986d366418b3c1cbf3abc293177 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 9 Aug 2019 16:26:33 -0700 Subject: [PATCH] Fix setting view background (#3470) --- cast/src/receiver/layout/hc-lovelace.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cast/src/receiver/layout/hc-lovelace.ts b/cast/src/receiver/layout/hc-lovelace.ts index d106579609..0be9488a54 100644 --- a/cast/src/receiver/layout/hc-lovelace.ts +++ b/cast/src/receiver/layout/hc-lovelace.ts @@ -52,10 +52,11 @@ class HcLovelace extends LitElement { protected updated(changedProps) { super.updated(changedProps); + if (changedProps.has("viewPath") || changedProps.has("lovelaceConfig")) { const index = this._viewIndex; - if (index) { + if (index !== undefined) { this.shadowRoot!.querySelector("hui-view")!.style.background = this.lovelaceConfig.views[index].background || this.lovelaceConfig.background ||