diff options
author | ThibG <thib@sitedethib.com> | 2019-03-24 19:15:58 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-03-24 19:15:58 +0100 |
commit | 94aceb85ad638cfd02fecce1aed0be5157bcb133 (patch) | |
tree | ab056c7833872ef957034fb1ed7ffcb6f7845424 | |
parent | ef8b9afd1be6abdac8cfe30507adca42c38ee7c8 (diff) |
Do not empty timeline of blocked users on block (#10359)
Fixes #10226
-rw-r--r-- | app/javascript/mastodon/reducers/timelines.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/javascript/mastodon/reducers/timelines.js b/app/javascript/mastodon/reducers/timelines.js index 94b570ecd..6a972f967 100644 --- a/app/javascript/mastodon/reducers/timelines.js +++ b/app/javascript/mastodon/reducers/timelines.js @@ -78,14 +78,15 @@ const updateTimeline = (state, timeline, status) => { })); }; -const deleteStatus = (state, id, accountId, references) => { +const deleteStatus = (state, id, accountId, references, exclude_account = null) => { state.keySeq().forEach(timeline => { - state = state.updateIn([timeline, 'items'], list => list.filterNot(item => item === id)); + if (exclude_account === null || (timeline !== `account:${exclude_account}` && !timeline.startsWith(`account:${exclude_account}:`))) + state = state.updateIn([timeline, 'items'], list => list.filterNot(item => item === id)); }); // Remove reblogs of deleted status references.forEach(ref => { - state = deleteStatus(state, ref[0], ref[1], []); + state = deleteStatus(state, ref[0], ref[1], [], exclude_account); }); return state; @@ -104,7 +105,7 @@ const filterTimelines = (state, relationship, statuses) => { } references = statuses.filter(item => item.get('reblog') === status.get('id')).map(item => [item.get('id'), item.get('account')]); - state = deleteStatus(state, status.get('id'), status.get('account'), references); + state = deleteStatus(state, status.get('id'), status.get('account'), references, relationship.id); }); return state; |