Skip to content

Commit 0a1fdae

Browse files
authored
Merge pull request #472 from bcgsc/bugfix/DEVSU-2796-variant-appearing-twice-in-VUS-table
bugfix/DEVSU-2796-variant-appearing-twice-in-VUS-table
2 parents d60b610 + 4bce94e commit 0a1fdae

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

app/routes/report/variants.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,14 @@ const getRapidReportVariants = async (tableName, variantType, reportId, rapidTab
353353

354354
// add variants back to unknownSig list, that are tagged for this table based on gene properties alone
355355
// so that they can be filtered out of results if they are in TA or CR
356-
unknownSignificanceResults.push(...unknownSignificanceFromGeneProperty);
356+
const existingVariants = new Set(unknownSignificanceResults.map((variant) => {return variant.ident;}));
357+
358+
unknownSignificanceFromGeneProperty.forEach((variant) => {
359+
if (!existingVariants.has(variant.ident)) {
360+
unknownSignificanceResults.push(variant);
361+
existingVariants.add(variant.ident);
362+
}
363+
});
357364

358365
// remove variants already included in a different section
359366
for (const row of unknownSignificanceResults) {

0 commit comments

Comments
 (0)