Skip to content
Snippets Groups Projects
Commit f1d72b0f authored by Xiao Gui's avatar Xiao Gui
Browse files

bugfix: modality filter not working

parent 3bbc65ce
No related branches found
No related tags found
No related merge requests found
......@@ -126,8 +126,18 @@ const getDs = ({ user }) => (user
/**
* remove duplicates
*/
const currSet = new Set(acc.map(v => v['fullId']))
if (currSet.has(curr['fullId'])) return [...acc]
const existingEntryIdx = acc.findIndex(v => v['fullId'] === curr['fullId'])
if (existingEntryIdx >= 0) {
const returnArr = [...acc].splice(existingEntryIdx, 1, {
...acc[existingEntryIdx],
...curr,
parcellationRegion: [
...(curr['parcellationRegion'] || []),
...(acc[existingEntryIdx]['parcellationRegion'] || [])
]
})
return returnArr
}
else return acc.concat(curr)
}, [])
})
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment