Guard against empty application credential domain (#17786)

This commit is contained in:
Simon Lamon 2023-09-04 19:21:56 +02:00 committed by GitHub
parent 77c08fd00f
commit 5bb8c51d25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,9 +80,7 @@ export class DialogAddApplicationCredential extends LitElement {
name: domainToName(this.hass.localize, domain),
}));
await this.hass.loadBackendTranslation("application_credentials");
if (this._domain) {
this._updateDescription();
}
this._updateDescription();
}
protected render() {
@ -265,11 +263,15 @@ export class DialogAddApplicationCredential extends LitElement {
}
private async _updateDescription() {
if (!this._domain) {
return;
}
await this.hass.loadBackendTranslation(
"application_credentials",
this._domain
);
const info = this._config!.integrations[this._domain!];
const info = this._config!.integrations[this._domain];
this._description = this.hass.localize(
`component.${this._domain}.application_credentials.description`,
info.description_placeholders