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