Fix bug where multiple entries in entity_config creates duplicates

This commit is contained in:
Aalian Khan
2023-03-28 15:10:05 -04:00
committed by GitHub
parent 3a5b2a1e5d
commit e8b065ea4e

View File

@@ -111,6 +111,7 @@ const createPlatformCard = (entities, entity_config, defaultCard, titleCard, dou
platformCards.push(titleCard);
}
entitiesLoop:
for (const entity of entities)
{
// Entity config does not exist then push defualt card, otherwise loop to find matching entity
@@ -148,10 +149,12 @@ const createPlatformCard = (entities, entity_config, defaultCard, titleCard, dou
...config
},
);
continue entitiesLoop;
}
}
} else
if (doubleTapActionConfig != null)
{
if (doubleTapActionConfig != null) {
var doubleTapAction =
{
double_tap_action:
@@ -164,6 +167,7 @@ const createPlatformCard = (entities, entity_config, defaultCard, titleCard, dou
}
}
}
platformCards.push
(
{
@@ -172,11 +176,10 @@ const createPlatformCard = (entities, entity_config, defaultCard, titleCard, dou
...doubleTapAction
}
)
}
}
}
}
return platformCards;
}