From 881e8662afbec1b2ec0fb9ddbd5f5ce5a9eee405 Mon Sep 17 00:00:00 2001 From: oakes Date: Tue, 27 Jun 2023 13:43:57 -0400 Subject: [PATCH] Make fetchRelationships import the data into Entities.RELATIONSHIPS --- app/soapbox/actions/accounts.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/soapbox/actions/accounts.ts b/app/soapbox/actions/accounts.ts index 4b7dcc57e4..9c967f98e5 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))); };