feat: Add "Followers you know" widget to user profiles (#34652)
This commit is contained in:
1 parent
c9a554bdca
commit
b135a831ea
12 files changed
+213
-17
No files matched your search
@@ -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),
|
||||
};
|
||||
},
|
||||
);
|
||||
Reference in new issue
Block a user