From bee629f7ed36ccd19131fb86c44ef1421bee213d Mon Sep 17 00:00:00 2001 From: Wendelin <12148533+wendevlin@users.noreply.github.com> Date: Fri, 8 Nov 2024 13:59:35 +0100 Subject: [PATCH] Improve stream and iOS checks in error-log-card (#22738) Improve stream and download checks in error-log-card --- src/panels/config/logs/error-log-card.ts | 29 ++++++++++-------------- src/util/is_ios.ts | 2 +- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/panels/config/logs/error-log-card.ts b/src/panels/config/logs/error-log-card.ts index 961af26baa..a5bd9e0b5f 100644 --- a/src/panels/config/logs/error-log-card.ts +++ b/src/panels/config/logs/error-log-card.ts @@ -339,31 +339,26 @@ class ErrorLogCard extends LitElement { protected willUpdate(changedProps: PropertyValues) { super.willUpdate(changedProps); - if ( - this._downloadSupported === undefined || - this._streamSupported === undefined - ) { + if (!this.hasUpdated) { this._downloadSupported = downloadFileSupported(this.hass); - this._streamSupported = atLeastVersion( - this.hass.config.version, - 2024, - 11 + this._streamSupported = + !__SUPERVISOR__ || atLeastVersion(this.hass.config.version, 2024, 11); + + // just needs to be loaded once, because only the host endpoints provide boots information + this._loadBoots(); + + window.addEventListener( + "connection-status", + this._handleConnectionStatus ); + + this.hass.loadFragmentTranslation("config"); } if (changedProps.has("provider")) { this._boot = 0; this._loadLogs(); } - if (this.hasUpdated) { - return; - } - // just needs to be loaded once, because only the host endpoints provide boots information - this._loadBoots(); - - window.addEventListener("connection-status", this._handleConnectionStatus); - - this.hass.loadFragmentTranslation("config"); } protected firstUpdated(changedProps: PropertyValues) { diff --git a/src/util/is_ios.ts b/src/util/is_ios.ts index b7f72ed2f5..f685e4d3bd 100644 --- a/src/util/is_ios.ts +++ b/src/util/is_ios.ts @@ -2,4 +2,4 @@ import type { HomeAssistant } from "../types"; import { isSafari } from "./is_safari"; export const isIosApp = (hass: HomeAssistant): boolean => - isSafari && !!hass.auth.external; + !!hass.auth.external && isSafari;