mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
fix race in assist pipeline dialog (#16380)
This commit is contained in:
parent
a6e71f4c0a
commit
6c0011fb45
@ -1,9 +1,10 @@
|
||||
import { css, CSSResultGroup, html, LitElement } from "lit";
|
||||
import { customElement, property } from "lit/decorators";
|
||||
import memoizeOne from "memoize-one";
|
||||
import { SchemaUnion } from "../../../../components/ha-form/types";
|
||||
import { LocalizeKeys } from "../../../../common/translations/localize";
|
||||
import { AssistPipeline } from "../../../../data/assist_pipeline";
|
||||
import { HomeAssistant } from "../../../../types";
|
||||
import "../../../../components/ha-form/ha-form";
|
||||
|
||||
@customElement("assist-pipeline-detail-config")
|
||||
export class AssistPipelineDetailConfig extends LitElement {
|
||||
@ -33,26 +34,28 @@ export class AssistPipelineDetailConfig extends LitElement {
|
||||
text: {},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "language",
|
||||
required: true,
|
||||
selector: {
|
||||
language: {
|
||||
languages: supportedLanguages ?? [],
|
||||
},
|
||||
},
|
||||
},
|
||||
supportedLanguages
|
||||
? {
|
||||
name: "language",
|
||||
required: true,
|
||||
selector: {
|
||||
language: {
|
||||
languages: supportedLanguages,
|
||||
},
|
||||
},
|
||||
}
|
||||
: { name: "", type: "constant" },
|
||||
] as const,
|
||||
},
|
||||
] as const
|
||||
);
|
||||
|
||||
private _computeLabel = (
|
||||
schema: SchemaUnion<ReturnType<typeof this._schema>>
|
||||
): string =>
|
||||
this.hass.localize(
|
||||
`ui.panel.config.voice_assistants.assistants.pipeline.detail.form.${schema.name}`
|
||||
);
|
||||
private _computeLabel = (schema): string =>
|
||||
schema.name
|
||||
? this.hass.localize(
|
||||
`ui.panel.config.voice_assistants.assistants.pipeline.detail.form.${schema.name}` as LocalizeKeys
|
||||
)
|
||||
: "";
|
||||
|
||||
protected render() {
|
||||
return html`
|
||||
|
@ -44,7 +44,7 @@ export class DialogVoiceAssistantPipelineDetail extends LitElement {
|
||||
|
||||
@state() private _submitting = false;
|
||||
|
||||
@state() private _supportedLanguages: string[] = [];
|
||||
@state() private _supportedLanguages?: string[];
|
||||
|
||||
public showDialog(params: VoiceAssistantPipelineDetailsDialogParams): void {
|
||||
this._params = params;
|
||||
|
Loading…
x
Reference in New Issue
Block a user