forked from DigiLive/mushroom-strategy
Merge pull request #1 from AalianKhan/AalianKhan-patch-1
Fix bug where multiple entries in entity_config creates duplicates
This commit is contained in:
11
dist/mushroom-strategy.js
vendored
11
dist/mushroom-strategy.js
vendored
@@ -111,6 +111,7 @@ const createPlatformCard = (entities, entity_config, defaultCard, titleCard, dou
|
|||||||
platformCards.push(titleCard);
|
platformCards.push(titleCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entitiesLoop:
|
||||||
for (const entity of entities)
|
for (const entity of entities)
|
||||||
{
|
{
|
||||||
// Entity config does not exist then push defualt card, otherwise loop to find matching entity
|
// 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
|
...config
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
continue entitiesLoop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else
|
if (doubleTapActionConfig != null)
|
||||||
{
|
{
|
||||||
if (doubleTapActionConfig != null) {
|
|
||||||
var doubleTapAction =
|
var doubleTapAction =
|
||||||
{
|
{
|
||||||
double_tap_action:
|
double_tap_action:
|
||||||
@@ -164,6 +167,7 @@ const createPlatformCard = (entities, entity_config, defaultCard, titleCard, dou
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
platformCards.push
|
platformCards.push
|
||||||
(
|
(
|
||||||
{
|
{
|
||||||
@@ -172,11 +176,10 @@ const createPlatformCard = (entities, entity_config, defaultCard, titleCard, dou
|
|||||||
...doubleTapAction
|
...doubleTapAction
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
return platformCards;
|
return platformCards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user