filter home when boosts are hidden

This commit is contained in:
Your Autistic Life 2024-01-15 04:38:03 -05:00
parent cc3ff66246
commit c429131800
3 changed files with 5 additions and 2 deletions

View File

@ -147,7 +147,7 @@ export function followAccount(id, options = { reblogs: true }) {
dispatch(followAccountRequest({ id, locked })); dispatch(followAccountRequest({ id, locked }));
api(getState).post(`/api/v1/accounts/${id}/follow`, options).then(response => { api(getState).post(`/api/v1/accounts/${id}/follow`, options).then(response => {
dispatch(followAccountSuccess({relationship: response.data, alreadyFollowing})); dispatch(followAccountSuccess({relationship: response.data, statuses: getState().get('statuses'), alreadyFollowing}));
}).catch(error => { }).catch(error => {
dispatch(followAccountFail({ id, error, locked })); dispatch(followAccountFail({ id, error, locked }));
}); });

View File

@ -24,6 +24,7 @@ export const followAccountSuccess = createAction(
'accounts/followAccount/SUCCESS', 'accounts/followAccount/SUCCESS',
actionWithSkipLoadingTrue<{ actionWithSkipLoadingTrue<{
relationship: ApiRelationshipJSON; relationship: ApiRelationshipJSON;
statuses: unknown;
alreadyFollowing: boolean; alreadyFollowing: boolean;
}>, }>,
); );

View File

@ -3,7 +3,8 @@ import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrde
import { import {
blockAccountSuccess, blockAccountSuccess,
muteAccountSuccess, muteAccountSuccess,
unfollowAccountSuccess unfollowAccountSuccess,
followAccountSuccess
} from '../actions/accounts'; } from '../actions/accounts';
import { import {
TIMELINE_UPDATE, TIMELINE_UPDATE,
@ -203,6 +204,7 @@ export default function timelines(state = initialState, action) {
case blockAccountSuccess.type: case blockAccountSuccess.type:
case muteAccountSuccess.type: case muteAccountSuccess.type:
return filterTimelines(state, action.payload.relationship, action.payload.statuses); return filterTimelines(state, action.payload.relationship, action.payload.statuses);
case followAccountSuccess.type:
case unfollowAccountSuccess.type: case unfollowAccountSuccess.type:
return filterTimeline('home', state, action.payload.relationship, action.payload.statuses); return filterTimeline('home', state, action.payload.relationship, action.payload.statuses);
case TIMELINE_SCROLL_TOP: case TIMELINE_SCROLL_TOP: