diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-10-07 12:16:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-07 12:16:39 +0200 |
commit | 11436358b4091c58532603adcd0f8b9d2e9e7775 (patch) | |
tree | 0052c5db921acdbe0e86da8d66ab96bad0e62fcb /app | |
parent | 0e0a9e716ca5adfe9ed8599df1c76dd8f1bfddcc (diff) |
Fix regression from #5206 - deduplicate descendants (#5253)
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/mastodon/reducers/contexts.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/javascript/mastodon/reducers/contexts.js b/app/javascript/mastodon/reducers/contexts.js index d8924e908..64d584a01 100644 --- a/app/javascript/mastodon/reducers/contexts.js +++ b/app/javascript/mastodon/reducers/contexts.js @@ -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; |