mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-09 18:36: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")
|
@customElement("ha-icon-button-arrow-next")
|
||||||
export class HaIconButtonArrowNext extends LitElement {
|
export class HaIconButtonArrowNext extends LitElement {
|
||||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||||
|
|
||||||
@property({ type: Boolean }) public disabled = false;
|
@property({ type: Boolean }) public disabled = false;
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ export class HaIconButtonArrowNext extends LitElement {
|
|||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
return html`<mwc-icon-button
|
return html`<mwc-icon-button
|
||||||
.disabled=${this.disabled}
|
.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>
|
<ha-svg-icon .path=${this._icon}></ha-svg-icon>
|
||||||
</mwc-icon-button> `;
|
</mwc-icon-button> `;
|
||||||
|
@ -13,7 +13,7 @@ import { HomeAssistant } from "../types";
|
|||||||
|
|
||||||
@customElement("ha-icon-button-arrow-prev")
|
@customElement("ha-icon-button-arrow-prev")
|
||||||
export class HaIconButtonArrowPrev extends LitElement {
|
export class HaIconButtonArrowPrev extends LitElement {
|
||||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||||
|
|
||||||
@property({ type: Boolean }) public disabled = false;
|
@property({ type: Boolean }) public disabled = false;
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ export class HaIconButtonArrowPrev extends LitElement {
|
|||||||
return html`
|
return html`
|
||||||
<mwc-icon-button
|
<mwc-icon-button
|
||||||
.disabled=${this.disabled}
|
.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>
|
<ha-svg-icon .path=${this._icon}></ha-svg-icon>
|
||||||
</mwc-icon-button>
|
</mwc-icon-button>
|
||||||
|
@ -13,7 +13,7 @@ import { HomeAssistant } from "../types";
|
|||||||
|
|
||||||
@customElement("ha-icon-button-next")
|
@customElement("ha-icon-button-next")
|
||||||
export class HaIconButtonNext extends LitElement {
|
export class HaIconButtonNext extends LitElement {
|
||||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||||
|
|
||||||
@property({ type: Boolean }) public disabled = false;
|
@property({ type: Boolean }) public disabled = false;
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ export class HaIconButtonNext extends LitElement {
|
|||||||
return html`
|
return html`
|
||||||
<mwc-icon-button
|
<mwc-icon-button
|
||||||
.disabled=${this.disabled}
|
.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>
|
<ha-svg-icon .path=${this._icon}></ha-svg-icon>
|
||||||
</mwc-icon-button>
|
</mwc-icon-button>
|
||||||
|
@ -13,7 +13,7 @@ import { HomeAssistant } from "../types";
|
|||||||
|
|
||||||
@customElement("ha-icon-button-prev")
|
@customElement("ha-icon-button-prev")
|
||||||
export class HaIconButtonPrev extends LitElement {
|
export class HaIconButtonPrev extends LitElement {
|
||||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||||
|
|
||||||
@property({ type: Boolean }) public disabled = false;
|
@property({ type: Boolean }) public disabled = false;
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ export class HaIconButtonPrev extends LitElement {
|
|||||||
return html`
|
return html`
|
||||||
<mwc-icon-button
|
<mwc-icon-button
|
||||||
.disabled=${this.disabled}
|
.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>
|
<ha-svg-icon .path=${this._icon}></ha-svg-icon>
|
||||||
</mwc-icon-button>
|
</mwc-icon-button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user