Don't send double card updated event when rendering the card (#25883)

This commit is contained in:
Paul Bottein 2025-06-23 14:10:27 +02:00 committed by Bram Kragten
parent 73cd1e8e9d
commit 45e66d8b6e

View File

@ -224,7 +224,9 @@ export class HuiCard extends ReactiveElement {
this._element.preview = this.preview;
// For backwards compatibility
(this._element as any).editMode = this.preview;
fireEvent(this, "card-updated");
if (this.hasUpdated) {
fireEvent(this, "card-updated");
}
} catch (e: any) {
// eslint-disable-next-line no-console
console.error(this.config?.type, e);