]> cat aescling's git repositories - mastodon.git/commitdiff
Fix regression from #5206 - deduplicate descendants (#5253)
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 7 Oct 2017 10:16:39 +0000 (12:16 +0200)
committerGitHub <noreply@github.com>
Sat, 7 Oct 2017 10:16:39 +0000 (12:16 +0200)
app/javascript/mastodon/reducers/contexts.js

index d8924e908b298dbc4e29b6fb91e38073647136cf..64d584a019cdfbcaccbaa505c488a86ae590a866 100644 (file)
@@ -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;