From 026587c40918cbf0e3bb4344c6a00e8850c19f14 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 21 Nov 2018 17:32:24 +0100 Subject: [PATCH] fix for showing links on all repos --- src/components/Repositories/Repository.jsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/Repositories/Repository.jsx b/src/components/Repositories/Repository.jsx index 38e56d27..ca8adba1 100644 --- a/src/components/Repositories/Repository.jsx +++ b/src/components/Repositories/Repository.jsx @@ -224,17 +224,17 @@ const Repository = ({ name, links, readme }) => ( // enhance passed links array with what's in repositories.yml, // iterating over all repos until we have a name match - const linksFilteredArray = repositoriesYaml.map(({ node }) => { - return node.items - .map(item => { - if (item.name === name) { - return item.links - } - }) - .filter(n => n)[0] + let linksFilteredArray = [] + + repositoriesYaml.map(({ node }) => { + node.items.forEach(item => { + if (item.name === name) { + linksFilteredArray.push(item.links) + } + }) }) - const moreLinks = links || linksFilteredArray[0] + const moreLinks = links || linksFilteredArray.filter(n => n)[0] return (