Skip to content

Commit

Permalink
remove duplicate rows (where external ID and address are the same) in…
Browse files Browse the repository at this point in the history
… the table on Xenium Analyser QC and Xenium metrics pages
  • Loading branch information
sabrine33 committed Oct 17, 2024
1 parent 18a2f40 commit 2090a79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/xeniumMetrics/RoiTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export const groupByRoi = (rois: RoiFieldsFragment[]): Record<string, RoiFieldsF
.sort((a, b) => alphaNumericSortDefault(a.address, b.address))
.reduce(
(acc, data) => {
if (!acc[data.roi]) {
acc[data.roi] = [];
const roiGroup = acc[data.roi] || (acc[data.roi] = []);
if (!roiGroup.some((item) => item.address === data.address && item.sample.id === data.sample.id)) {
roiGroup.push(data);
}
acc[data.roi].push(data);
return acc;
},
{} as Record<string, RoiFieldsFragment[]>
Expand Down

0 comments on commit 2090a79

Please sign in to comment.