Skip to content
Snippets Groups Projects
Unverified Commit b5dfb5bb authored by xgui3783's avatar xgui3783 Committed by GitHub
Browse files

Merge pull request #797 from HumanBrainProject/bugfix_modalityFilterNotWorking

bugfix: restore modality filter functionality
parents 96d0f986 f1d72b0f
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