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({
|
var SearchResults = React.createClass({
|
||||||
render: function() {
|
render: function() {
|
||||||
var rows = [];
|
var rows = [],
|
||||||
|
seenNames = {}; //fix this when the search API returns claim IDs
|
||||||
this.props.results.forEach(function({name, value}) {
|
this.props.results.forEach(function({name, value}) {
|
||||||
|
if (!seenNames[name]) {
|
||||||
|
seenNames[name] = name;
|
||||||
rows.push(
|
rows.push(
|
||||||
<FileTile key={name} name={name} />
|
<FileTile key={name} name={name} />
|
||||||
);
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<div>{rows}</div>
|
<div>{rows}</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue