From c16bf7209112221d927c0ceaade8ae75c26231c5 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 25 Sep 2024 10:00:48 +0200 Subject: [PATCH] Triggers doesnt have to be an array, fix flattenTriggers --- src/data/automation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/automation.ts b/src/data/automation.ts index 10c193cd9d46..1cae92060b61 100644 --- a/src/data/automation.ts +++ b/src/data/automation.ts @@ -413,7 +413,7 @@ export const migrateAutomationConfig = < }; export const flattenTriggers = ( - triggers: undefined | (Trigger | TriggerList)[] + triggers: undefined | Trigger | (Trigger | TriggerList)[] ): Trigger[] => { if (!triggers) { return []; @@ -421,7 +421,7 @@ export const flattenTriggers = ( const flatTriggers: Trigger[] = []; - triggers.forEach((t) => { + ensureArray(triggers).forEach((t) => { if ("triggers" in t) { if (t.triggers) { flatTriggers.push(...ensureArray(t.triggers));