From 12a77a699803526d07744979fa4b787b87bf7e93 Mon Sep 17 00:00:00 2001 From: George Thomas <98996322+george42-ctds@users.noreply.github.com> Date: Thu, 13 Oct 2022 06:47:46 -0700 Subject: [PATCH] fix: skip empty tags in discovery page (#1118) * fix: skip empty tags in discovery page * fix: shorten checks for empty tags --- src/Discovery/aggMDSUtils.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Discovery/aggMDSUtils.jsx b/src/Discovery/aggMDSUtils.jsx index 0b8f62ef7e..17a01dde85 100644 --- a/src/Discovery/aggMDSUtils.jsx +++ b/src/Discovery/aggMDSUtils.jsx @@ -18,7 +18,8 @@ const retrieveCommonsInfo = async (commonsName) => { * @param {*} tags * @returns array with duplicates removed */ -const getUniqueTags = ((tags) => tags.filter((v, i, a) => a.findIndex((t) => (t.category === v.category && t.name === v.name)) === i)); +const getUniqueTags = ((tags) => tags.filter((v, i, a) => a.findIndex((t) => ( + t.name?.length > 0 && t.category === v.category && t.name === v.name)) === i)); const loadStudiesFromAggMDSRequests = async (offset, limit) => { const url = `${aggMDSDataURL}?data=True&limit=${limit}&offset=${offset}`;