feat: Add "Followers you know" widget to user profiles (#34652)

This commit is contained in:
diondiondion 2025-05-13 08:38:18 +02:00 committed by GitHub
commit b135a831ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 213 additions and 17 deletions

View file

@ -0,0 +1,22 @@
import { createDataLoadingThunk } from 'mastodon/store/typed_functions';
import { apiGetFamiliarFollowers } from '../api/accounts';
import { importFetchedAccounts } from './importer';
export const fetchAccountsFamiliarFollowers = createDataLoadingThunk(
'accounts_familiar_followers/fetch',
({ id }: { id: string }) => apiGetFamiliarFollowers(id),
([data], { dispatch }) => {
if (!data) {
return null;
}
dispatch(importFetchedAccounts(data.accounts));
return {
id: data.id,
accountIds: data.accounts.map((account) => account.id),
};
},
);