Improve stream and iOS checks in error-log-card (#22738)

Improve stream and download checks in error-log-card
This commit is contained in:
Wendelin 2024-11-08 13:59:35 +01:00 committed by GitHub
parent d8df380edc
commit bee629f7ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 18 deletions

View File

@ -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) {

View File

@ -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;