Updated fetchRelationships for accounts and importing
• Updated: - fetchRelationships for accounts and importing relationships on timeline fetches
This commit is contained in:
@@ -577,7 +577,10 @@ export function fetchRelationships(accountIds) {
|
||||
if (!me) return;
|
||||
|
||||
const loadedRelationships = getState().get('relationships');
|
||||
const newAccountIds = accountIds.filter(id => loadedRelationships.get(id, null) === null);
|
||||
let newAccountIds = accountIds.filter((id) => {
|
||||
if (id === me) return false
|
||||
return loadedRelationships.get(id, null) === null
|
||||
})
|
||||
|
||||
if (newAccountIds.length === 0) {
|
||||
return;
|
||||
@@ -586,6 +589,9 @@ export function fetchRelationships(accountIds) {
|
||||
if (me === firstId) return;
|
||||
}
|
||||
|
||||
// Unique
|
||||
newAccountIds = Array.from(new Set(newAccountIds))
|
||||
|
||||
dispatch(fetchRelationshipsRequest(newAccountIds));
|
||||
|
||||
api(getState).get(`/api/v1/accounts/relationships?${newAccountIds.map(id => `id[]=${id}`).join('&')}`).then(response => {
|
||||
|
||||
Reference in New Issue
Block a user