Skip to content

Commit

Permalink
Minor update and add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ddjnw1yu committed Jul 4, 2024
1 parent 4577e57 commit 9de0ca3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions components/ImagesGallery/ImagesGallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -517,16 +517,15 @@ export default {
immediate: true,
handler: function(biolucidaData) {
const biolucida2DItems = pathOr([], ['dataset_info','biolucida-2d'], biolucidaData)
const biolucida3DItems = pathOr([], ['dataset_info','biolucida-3d'], biolucidaData)
let items = []
const baseRoute = this.$router.options.base || '/'
if ('dataset_images' in biolucidaData) {
// Images need to exist in both Scicrunch and Biolucida
const validBiolucidaData = biolucidaData.dataset_images.filter(bObject => {
return (
biolucida2DItems.some(b2DItem => pathOr("", ['biolucida', 'identifier'], b2DItem) == bObject.image_id) ||
biolucida3DItems.some(b3DItem => pathOr("", ['biolucida', 'identifier'], b3DItem) == bObject.image_id)
)
const biolucidaItems = biolucida2DItems.concat(pathOr([], ['dataset_info','biolucida-3d'], biolucidaData))
return biolucidaItems.some(bItem => pathOr("", ['biolucida','identifier'], bItem) == bObject.image_id)
})
// Duplicate images ids may exist
const uniqueBiolucidaData = validBiolucidaData.filter((bObject, index) => {
return index == validBiolucidaData.findIndex(bObject2 => bObject.image_id == bObject2.image_id);
})
Expand Down

0 comments on commit 9de0ca3

Please sign in to comment.