From 11436358b4091c58532603adcd0f8b9d2e9e7775 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 7 Oct 2017 12:16:39 +0200 Subject: [PATCH] Fix regression from #5206 - deduplicate descendants (#5253) --- app/javascript/mastodon/reducers/contexts.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/reducers/contexts.js b/app/javascript/mastodon/reducers/contexts.js index d8924e908b..64d584a019 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;