Fix checking cloudhooks exist (#2893)

This commit is contained in:
Paulus Schoutsen 2019-03-07 10:53:24 -08:00 committed by Paulus Schoutsen
parent 3e5d372bbe
commit 836844a312
2 changed files with 7 additions and 7 deletions

View File

@ -4,6 +4,7 @@ export interface CloudWebhook {
webhook_id: string;
cloudhook_id: string;
cloudhook_url: string;
managed?: boolean;
}
export const createCloudhook = (hass: HomeAssistant, webhookId: string) =>

View File

@ -121,9 +121,9 @@ export class CloudWebhooks extends LitElement {
`
: this._cloudHooks![entry.webhook_id]
? html`
<mwc-button @click="${this._handleManageButton}"
>Manage</mwc-button
>
<mwc-button @click="${this._handleManageButton}">
Manage
</mwc-button>
`
: html`
<paper-toggle-button
@ -195,10 +195,9 @@ export class CloudWebhooks extends LitElement {
}
private async _fetchData() {
this._localHooks =
"webhook" in this.hass!.config.components
? await fetchWebhooks(this.hass!)
: [];
this._localHooks = this.hass!.config.components.includes("webhook")
? await fetchWebhooks(this.hass!)
: [];
}
private renderStyle() {