diff --git a/app/soapbox/actions/accounts.ts b/app/soapbox/actions/accounts.ts index 4b7dcc57e..9c967f98e 100644 --- a/app/soapbox/actions/accounts.ts +++ b/app/soapbox/actions/accounts.ts @@ -1,3 +1,5 @@ +import { importEntities } from 'soapbox/entity-store/actions'; +import { Entities } from 'soapbox/entity-store/entities'; import { isLoggedIn } from 'soapbox/utils/auth'; import { getFeatures, parseVersion, PLEROMA } from 'soapbox/utils/features'; @@ -607,7 +609,10 @@ const fetchRelationships = (accountIds: string[]) => return api(getState) .get(`/api/v1/accounts/relationships?${newAccountIds.map(id => `id[]=${id}`).join('&')}`) - .then(response => dispatch(fetchRelationshipsSuccess(response.data))) + .then(response => { + dispatch(importEntities(response.data, Entities.RELATIONSHIPS)); + dispatch(fetchRelationshipsSuccess(response.data)); + }) .catch(error => dispatch(fetchRelationshipsFail(error))); }; diff --git a/app/soapbox/actions/familiar-followers.ts b/app/soapbox/actions/familiar-followers.ts index 2c82126c6..ee38084ba 100644 --- a/app/soapbox/actions/familiar-followers.ts +++ b/app/soapbox/actions/familiar-followers.ts @@ -2,8 +2,11 @@ import { AppDispatch, RootState } from 'soapbox/store'; import api from '../api'; +import { fetchRelationships } from './accounts'; import { importFetchedAccounts } from './importer'; +import type { APIEntity } from 'soapbox/types/entities'; + export const FAMILIAR_FOLLOWERS_FETCH_REQUEST = 'FAMILIAR_FOLLOWERS_FETCH_REQUEST'; export const FAMILIAR_FOLLOWERS_FETCH_SUCCESS = 'FAMILIAR_FOLLOWERS_FETCH_SUCCESS'; export const FAMILIAR_FOLLOWERS_FETCH_FAIL = 'FAMILIAR_FOLLOWERS_FETCH_FAIL'; @@ -19,6 +22,7 @@ export const fetchAccountFamiliarFollowers = (accountId: string) => (dispatch: A const accounts = data.find(({ id }: { id: string }) => id === accountId).accounts; dispatch(importFetchedAccounts(accounts)); + dispatch(fetchRelationships(accounts.map((item: APIEntity) => item.id))); dispatch({ type: FAMILIAR_FOLLOWERS_FETCH_SUCCESS, id: accountId, diff --git a/app/soapbox/features/ui/components/modals/familiar-followers-modal.tsx b/app/soapbox/features/ui/components/modals/familiar-followers-modal.tsx index 8bbd7adff..67e2d1dce 100644 --- a/app/soapbox/features/ui/components/modals/familiar-followers-modal.tsx +++ b/app/soapbox/features/ui/components/modals/familiar-followers-modal.tsx @@ -35,6 +35,8 @@ const FamiliarFollowersModal = ({ accountId, onClose }: IFamiliarFollowersModal) scrollKey='familiar_followers' emptyMessage={emptyMessage} itemClassName='pb-3' + style={{ height: '80vh' }} + useWindowScroll={false} > {familiarFollowerIds.map(id => ,