From f3003417c5e109f41912b3595536c6adae81c97b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 17 Oct 2017 22:17:02 +0200 Subject: [PATCH] When unreblog arrives over streaming API, just delete in UI (#5439) --- app/javascript/mastodon/reducers/timelines.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/javascript/mastodon/reducers/timelines.js b/app/javascript/mastodon/reducers/timelines.js index c3f117647..bee4c4ef9 100644 --- a/app/javascript/mastodon/reducers/timelines.js +++ b/app/javascript/mastodon/reducers/timelines.js @@ -75,15 +75,9 @@ const updateTimeline = (state, timeline, status, references) => { })); }; -const deleteStatus = (state, id, accountId, references, reblogOf) => { +const deleteStatus = (state, id, accountId, references) => { state.keySeq().forEach(timeline => { - state = state.updateIn([timeline, 'items'], list => { - if (reblogOf && !list.includes(reblogOf)) { - return list.map(item => item === id ? reblogOf : item); - } else { - return list.filterNot(item => item === id); - } - }); + state = state.updateIn([timeline, 'items'], list => list.filterNot(item => item === id)); }); // Remove reblogs of deleted status