Skip to content

Commit

Permalink
Fix regression from #5206 - deduplicate descendants (#5253)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron committed Oct 7, 2017
1 parent 0e0a9e7 commit 1143635
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/javascript/mastodon/reducers/contexts.js
Expand Up @@ -34,7 +34,13 @@ const deleteFromContexts = (state, id) => {
const updateContext = (state, status, references) => {
return state.update('descendants', map => {
references.forEach(parentId => {
map = map.update(parentId, ImmutableList(), list => list.push(status.id));
map = map.update(parentId, ImmutableList(), list => {
if (list.includes(status.id)) {
return list;
}

return list.push(status.id);
});
});

return map;
Expand Down

0 comments on commit 1143635

Please sign in to comment.