Skip to content

Commit 64c6942

Browse files
authored
ENG-490 - removing duplicates from expected inputs in Inputs.tsx and fireQuery.ts (#459)
1 parent 17dd710 commit 64c6942

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

apps/roam/src/components/results-view/Inputs.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ export const Inputs = ({
178178
),
179179
)
180180
.filter((t) => /^:in /.test(t))
181-
.map((t) => t.substring(4));
181+
.map((t) => t.substring(4))
182+
.filter((value, index, array) => array.indexOf(value) === index); // Remove duplicates
182183
};
183184

184185
const newInputs = getExpectedInputs().map((key) => {

apps/roam/src/utils/fireQuery.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ export const getDatalogQuery = ({
192192
const expectedInputs = getConditionTargets(conditions)
193193
.filter((c) => /^:in /.test(c))
194194
.map((c) => c.substring(4))
195-
.filter((c) => !!inputs[c]);
195+
.filter((c) => !!inputs[c])
196+
.filter((value, index, array) => array.indexOf(value) === index); // Remove duplicates
196197
const whereClauses = optimizeQuery(
197198
getWhereClauses({ conditions, returnNode }),
198199
new Set([]),

0 commit comments

Comments
 (0)