mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +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,
|
||||
CloudWebhook,
|
||||
} from "../../../data/cloud";
|
||||
import { ERR_UNKNOWN_COMMAND } from "../../../data/websocket_api";
|
||||
|
||||
declare global {
|
||||
// for fire event
|
||||
@ -196,15 +195,10 @@ export class CloudWebhooks extends LitElement {
|
||||
}
|
||||
|
||||
private async _fetchData() {
|
||||
try {
|
||||
this._localHooks = await fetchWebhooks(this.hass!);
|
||||
} catch (err) {
|
||||
if (err.code === ERR_UNKNOWN_COMMAND) {
|
||||
this._localHooks = [];
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
this._localHooks =
|
||||
"webhook" in this.hass!.config.components
|
||||
? await fetchWebhooks(this.hass!)
|
||||
: [];
|
||||
}
|
||||
|
||||
private renderStyle() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user