From 6c67cee3d96e21b30e287baa5c5022f74cbf174d Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Thu, 12 Jan 2017 23:12:53 -0500 Subject: [PATCH] fix duplicate keys on search results --- js/page/discover.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/page/discover.js b/js/page/discover.js index d627df4d3..dcbf190e9 100644 --- a/js/page/discover.js +++ b/js/page/discover.js @@ -41,11 +41,15 @@ var SearchNoResults = React.createClass({ var SearchResults = React.createClass({ render: function() { - var rows = []; + var rows = [], + seenNames = {}; //fix this when the search API returns claim IDs this.props.results.forEach(function({name, value}) { - rows.push( - - ); + if (!seenNames[name]) { + seenNames[name] = name; + rows.push( + + ); + } }); return (
{rows}