diff --git a/app/javascript/mastodon/actions/accounts.js b/app/javascript/mastodon/actions/accounts.js index 9f3bbba033..bdd2e0a3eb 100644 --- a/app/javascript/mastodon/actions/accounts.js +++ b/app/javascript/mastodon/actions/accounts.js @@ -147,7 +147,7 @@ export function followAccount(id, options = { reblogs: true }) { dispatch(followAccountRequest({ id, locked })); 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 => { dispatch(followAccountFail({ id, error, locked })); }); diff --git a/app/javascript/mastodon/actions/accounts_typed.ts b/app/javascript/mastodon/actions/accounts_typed.ts index 058a68a099..dbb1020ca4 100644 --- a/app/javascript/mastodon/actions/accounts_typed.ts +++ b/app/javascript/mastodon/actions/accounts_typed.ts @@ -24,6 +24,7 @@ export const followAccountSuccess = createAction( 'accounts/followAccount/SUCCESS', actionWithSkipLoadingTrue<{ relationship: ApiRelationshipJSON; + statuses: unknown; alreadyFollowing: boolean; }>, ); diff --git a/app/javascript/mastodon/reducers/timelines.js b/app/javascript/mastodon/reducers/timelines.js index 43dedd6e6d..e3abbaea3b 100644 --- a/app/javascript/mastodon/reducers/timelines.js +++ b/app/javascript/mastodon/reducers/timelines.js @@ -3,7 +3,8 @@ import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrde import { blockAccountSuccess, muteAccountSuccess, - unfollowAccountSuccess + unfollowAccountSuccess, + followAccountSuccess } from '../actions/accounts'; import { TIMELINE_UPDATE, @@ -203,6 +204,7 @@ export default function timelines(state = initialState, action) { case blockAccountSuccess.type: case muteAccountSuccess.type: return filterTimelines(state, action.payload.relationship, action.payload.statuses); + case followAccountSuccess.type: case unfollowAccountSuccess.type: return filterTimeline('home', state, action.payload.relationship, action.payload.statuses); case TIMELINE_SCROLL_TOP: