Fix loading behavior when manually typing card type (#25502)

This commit is contained in:
karwosts 2025-05-17 22:57:59 -07:00 committed by GitHub
parent 5d4805cde6
commit 7e56d5f351
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,6 +82,8 @@ export abstract class HuiElementEditor<
@query("ha-yaml-editor") _yamlEditor?: HaYamlEditor;
private _loadCount = 0;
public get value(): T | undefined {
return this._config;
}
@ -411,7 +413,7 @@ export abstract class HuiElementEditor<
if (!this.value) {
return;
}
const loadNum = ++this._loadCount;
try {
this._errors = undefined;
this._warnings = undefined;
@ -435,6 +437,9 @@ export abstract class HuiElementEditor<
this.GUImode = false;
}
} catch (err: any) {
if (loadNum !== this._loadCount) {
return;
}
if (err instanceof GUISupportError) {
this._warnings = err.warnings ?? [err.message];
this._errors = err.errors || undefined;