about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-10-07 12:16:39 +0200
committerGitHub <noreply@github.com>2017-10-07 12:16:39 +0200
commit11436358b4091c58532603adcd0f8b9d2e9e7775 (patch)
tree0052c5db921acdbe0e86da8d66ab96bad0e62fcb
parent0e0a9e716ca5adfe9ed8599df1c76dd8f1bfddcc (diff)
Fix regression from #5206 - deduplicate descendants (#5253)
-rw-r--r--app/javascript/mastodon/reducers/contexts.js8
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;