mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Triggers doesn't have to be an array, fix flattenTriggers (#22072)
Triggers doesnt have to be an array, fix flattenTriggers
This commit is contained in:
parent
305cecb213
commit
265bbfc95d
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user