feat: Add "Followers you know" widget to user profiles (#34652)
This commit is contained in:
parent
c9a554bdca
commit
b135a831ea
12 changed files with 213 additions and 17 deletions
|
|
@ -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),
|
||||
};
|
||||
},
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue