fix duplicate keys on search results
This commit is contained in:
parent
4fd9828760
commit
6c67cee3d9
1 changed files with 8 additions and 4 deletions
|
@ -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(
|
||||
<FileTile key={name} name={name} />
|
||||
);
|
||||
if (!seenNames[name]) {
|
||||
seenNames[name] = name;
|
||||
rows.push(
|
||||
<FileTile key={name} name={name} />
|
||||
);
|
||||
}
|
||||
});
|
||||
return (
|
||||
<div>{rows}</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue