Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix application credentials description when loaded from config flow #12940

Merged
merged 1 commit into from
Jun 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ export class DialogAddApplicationCredential extends LitElement {
id: domain,
name: domainToName(this.hass.localize, domain),
}));
this.hass.loadBackendTranslation("application_credentials");
await this.hass.loadBackendTranslation("application_credentials");
if (this._domain !== "") {
this._updateDescription();
}
}

protected render(): TemplateResult {
Expand Down Expand Up @@ -182,9 +185,13 @@ export class DialogAddApplicationCredential extends LitElement {
fireEvent(this, "dialog-closed", { dialog: this.localName });
}

private async _handleDomainPicked(ev: CustomEvent) {
private _handleDomainPicked(ev: CustomEvent) {
ev.stopPropagation();
this._domain = ev.detail.value;
this._updateDescription();
}

private _updateDescription() {
const info = this._config!.integrations[this._domain!];
this._description = this.hass.localize(
`component.${this._domain}.application_credentials.description`,
Expand Down