Skip to content

Commit

Permalink
Improve stream and iOS checks in error-log-card (#22738)
Browse files Browse the repository at this point in the history
Improve stream and download checks in error-log-card
  • Loading branch information
wendevlin authored Nov 8, 2024
1 parent d8df380 commit bee629f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
29 changes: 12 additions & 17 deletions src/panels/config/logs/error-log-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/util/is_ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit bee629f

Please sign in to comment.