mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-09 10:26:35 +00:00
Guard for undefined hass (#7647)
This commit is contained in:
parent
3186d762f2
commit
e84bef44b7
@ -13,7 +13,7 @@ import { HomeAssistant } from "../types";
|
||||
|
||||
@customElement("ha-icon-button-arrow-next")
|
||||
export class HaIconButtonArrowNext extends LitElement {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property({ type: Boolean }) public disabled = false;
|
||||
|
||||
@ -36,7 +36,7 @@ export class HaIconButtonArrowNext extends LitElement {
|
||||
protected render(): TemplateResult {
|
||||
return html`<mwc-icon-button
|
||||
.disabled=${this.disabled}
|
||||
.label=${this.label || this.hass.localize("ui.common.next")}
|
||||
.label=${this.label || this.hass?.localize("ui.common.next") || "Next"}
|
||||
>
|
||||
<ha-svg-icon .path=${this._icon}></ha-svg-icon>
|
||||
</mwc-icon-button> `;
|
||||
|
@ -13,7 +13,7 @@ import { HomeAssistant } from "../types";
|
||||
|
||||
@customElement("ha-icon-button-arrow-prev")
|
||||
export class HaIconButtonArrowPrev extends LitElement {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property({ type: Boolean }) public disabled = false;
|
||||
|
||||
@ -37,7 +37,7 @@ export class HaIconButtonArrowPrev extends LitElement {
|
||||
return html`
|
||||
<mwc-icon-button
|
||||
.disabled=${this.disabled}
|
||||
.label=${this.label || this.hass.localize("ui.common.back")}
|
||||
.label=${this.label || this.hass?.localize("ui.common.back") || "Back"}
|
||||
>
|
||||
<ha-svg-icon .path=${this._icon}></ha-svg-icon>
|
||||
</mwc-icon-button>
|
||||
|
@ -13,7 +13,7 @@ import { HomeAssistant } from "../types";
|
||||
|
||||
@customElement("ha-icon-button-next")
|
||||
export class HaIconButtonNext extends LitElement {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property({ type: Boolean }) public disabled = false;
|
||||
|
||||
@ -37,7 +37,7 @@ export class HaIconButtonNext extends LitElement {
|
||||
return html`
|
||||
<mwc-icon-button
|
||||
.disabled=${this.disabled}
|
||||
.label=${this.label || this.hass.localize("ui.common.next")}
|
||||
.label=${this.label || this.hass?.localize("ui.common.next") || "Next"}
|
||||
>
|
||||
<ha-svg-icon .path=${this._icon}></ha-svg-icon>
|
||||
</mwc-icon-button>
|
||||
|
@ -13,7 +13,7 @@ import { HomeAssistant } from "../types";
|
||||
|
||||
@customElement("ha-icon-button-prev")
|
||||
export class HaIconButtonPrev extends LitElement {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property({ type: Boolean }) public disabled = false;
|
||||
|
||||
@ -37,7 +37,7 @@ export class HaIconButtonPrev extends LitElement {
|
||||
return html`
|
||||
<mwc-icon-button
|
||||
.disabled=${this.disabled}
|
||||
.label=${this.label || this.hass.localize("ui.common.back")}
|
||||
.label=${this.label || this.hass?.localize("ui.common.back") || "Back"}
|
||||
>
|
||||
<ha-svg-icon .path=${this._icon}></ha-svg-icon>
|
||||
</mwc-icon-button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user