dont split a string

This commit is contained in:
Bram Kragten 2023-06-29 17:14:05 +02:00
parent f712b76ccf
commit a5c7f261c8
No known key found for this signature in database
GPG Key ID: FBE2DFDB363EF55B

View File

@ -92,7 +92,11 @@ export class HaConversationTrigger
private async _updateOption(ev: Event) {
const index = (ev.target as any).index;
const command = [...this.trigger.command];
const command = [
...(Array.isArray(this.trigger.command)
? this.trigger.command
: [this.trigger.command]),
];
command.splice(index, 1, (ev.target as HaTextField).value);
fireEvent(this, "value-changed", {
value: { ...this.trigger, command },