Skip to content

Commit 00871dd

Browse files
committed
fix: adding logic to choose only unique entities
1 parent 827efcf commit 00871dd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/Cards/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const { MessageFactory, CardFactory } = require("botbuilder");
22
const isEmpty = require("lodash.isempty");
3+
const uniqWith = require("lodash.uniqwith");
4+
const isEqual = require("lodash.isequal");
35

46
class Cards {
57
/**
@@ -41,7 +43,7 @@ class Cards {
4143
msteams.width = "full";
4244
}
4345
if (!isEmpty(entities)) {
44-
msteams.entities = entities;
46+
msteams.entities = uniqWith(entities, isEqual);
4547
}
4648
return CardFactory.adaptiveCard({
4749
type: "AdaptiveCard",

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
"dependencies": {
2121
"@commitlint/cli": "^16.2.3",
2222
"@commitlint/config-conventional": "^16.2.1",
23-
"botbuilder": "^4.11.1",
23+
"botbuilder": "^4.16.0",
2424
"lodash.isempty": "^4.4.0",
25+
"lodash.isequal": "^4.5.0",
26+
"lodash.uniqwith": "^4.5.0",
2527
"node-emoji": "^1.11.0"
2628
},
2729
"devDependencies": {

0 commit comments

Comments
 (0)