mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-16 13:56:35 +00:00
Fix error on hardware page (#23021)
* fix error on hardware page * Update ha-config-hardware.ts
This commit is contained in:
parent
71214351ca
commit
f54bb20fef
@ -37,6 +37,7 @@ import { haStyle } from "../../../resources/styles";
|
||||
import type { HomeAssistant } from "../../../types";
|
||||
import { hardwareBrandsUrl } from "../../../util/brands-url";
|
||||
import { showhardwareAvailableDialog } from "./show-dialog-hardware-available";
|
||||
import { extractApiErrorMessage } from "../../../data/hassio/common";
|
||||
|
||||
const DATASAMPLES = 60;
|
||||
|
||||
@ -55,7 +56,7 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
|
||||
|
||||
@property({ type: Boolean }) public narrow = false;
|
||||
|
||||
@state() private _error?: { code: string; message: string };
|
||||
@state() private _error?: string;
|
||||
|
||||
@state() private _OSData?: HassioHassOSInfo;
|
||||
|
||||
@ -268,11 +269,7 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
|
||||
`
|
||||
: ""}
|
||||
${this._error
|
||||
? html`
|
||||
<ha-alert alert-type="error"
|
||||
>${this._error.message || this._error.code}</ha-alert
|
||||
>
|
||||
`
|
||||
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
|
||||
: ""}
|
||||
<div class="content">
|
||||
${boardName || isComponentLoaded(this.hass, "hassio")
|
||||
@ -466,7 +463,7 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
|
||||
this._OSData = await fetchHassioHassOsInfo(this.hass);
|
||||
}
|
||||
} catch (err: any) {
|
||||
this._error = err.message || err;
|
||||
this._error = extractApiErrorMessage(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user