mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 23:36:36 +00:00
Do not fire command if we know component not loaded (#2875)
This commit is contained in:
parent
34c6356a47
commit
241d7345d0
@ -20,7 +20,6 @@ import {
|
|||||||
deleteCloudhook,
|
deleteCloudhook,
|
||||||
CloudWebhook,
|
CloudWebhook,
|
||||||
} from "../../../data/cloud";
|
} from "../../../data/cloud";
|
||||||
import { ERR_UNKNOWN_COMMAND } from "../../../data/websocket_api";
|
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
// for fire event
|
// for fire event
|
||||||
@ -196,15 +195,10 @@ export class CloudWebhooks extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _fetchData() {
|
private async _fetchData() {
|
||||||
try {
|
this._localHooks =
|
||||||
this._localHooks = await fetchWebhooks(this.hass!);
|
"webhook" in this.hass!.config.components
|
||||||
} catch (err) {
|
? await fetchWebhooks(this.hass!)
|
||||||
if (err.code === ERR_UNKNOWN_COMMAND) {
|
: [];
|
||||||
this._localHooks = [];
|
|
||||||
} else {
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderStyle() {
|
private renderStyle() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user