Skip to content

Commit

Permalink
Fix regression from mastodon#5206 - deduplicate descendants (mastodon…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored and rutan committed Oct 11, 2017
1 parent 38d0981 commit 432daae
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 432daae

Please sign in to comment.