Skip to content

Commit c9a3ac4

Browse files
ClearlyClaireGargron
authored andcommitted
Do not empty timeline of blocked users on block (mastodon#10359)
Fixes mastodon#10226
1 parent bd6f722 commit c9a3ac4

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

app/javascript/mastodon/reducers/timelines.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,15 @@ const updateTimeline = (state, timeline, status) => {
7878
}));
7979
};
8080

81-
const deleteStatus = (state, id, accountId, references) => {
81+
const deleteStatus = (state, id, accountId, references, exclude_account = null) => {
8282
state.keySeq().forEach(timeline => {
83-
state = state.updateIn([timeline, 'items'], list => list.filterNot(item => item === id));
83+
if (exclude_account === null || (timeline !== `account:${exclude_account}` && !timeline.startsWith(`account:${exclude_account}:`)))
84+
state = state.updateIn([timeline, 'items'], list => list.filterNot(item => item === id));
8485
});
8586

8687
// Remove reblogs of deleted status
8788
references.forEach(ref => {
88-
state = deleteStatus(state, ref[0], ref[1], []);
89+
state = deleteStatus(state, ref[0], ref[1], [], exclude_account);
8990
});
9091

9192
return state;
@@ -104,7 +105,7 @@ const filterTimelines = (state, relationship, statuses) => {
104105
}
105106

106107
references = statuses.filter(item => item.get('reblog') === status.get('id')).map(item => [item.get('id'), item.get('account')]);
107-
state = deleteStatus(state, status.get('id'), status.get('account'), references);
108+
state = deleteStatus(state, status.get('id'), status.get('account'), references, relationship.id);
108109
});
109110

110111
return state;

0 commit comments

Comments
 (0)