Browse Source

Do not empty timeline of blocked users on block (#10359)

Fixes #10226
pull/4/head
ThibG 5 years ago
committed by Eugen Rochko
parent
commit
94aceb85ad
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      app/javascript/mastodon/reducers/timelines.js

+ 5
- 4
app/javascript/mastodon/reducers/timelines.js View File

@ -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;

Loading…
Cancel
Save