Skip to content

Commit

Permalink
Prevent duplicated keys in groups on the applist
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Hinrichsen committed Mar 21, 2016
1 parent 4861791 commit b7bd2d3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/js/components/AppListComponent.jsx
Expand Up @@ -410,15 +410,26 @@ var AppListComponent = React.createClass({
);
}

var appListItems = items.map(app => {
var appListItems = items.reduce((apps, item) => {
var {id} = item;
if (apps[id] == null) {
apps[id] = {};
}
Object.assign(apps[id], item);
return apps;
}, {});

appListItems = Object.keys(appListItems).map(key => {
return appListItems[key];
}).map((app) => {
return (
<AppListItemComponent key={app.id}
model={app}
currentGroup={props.currentGroup}
sortKey={sortKey}
viewType={appListViewType}/>
);
}).value();
});

AppsActions.emitFilterCounts(filterCounts);

Expand Down

0 comments on commit b7bd2d3

Please sign in to comment.