Fixed issue where follow button was not showing on profiles

• Fixed:
- issue where follow button was not showing on profiles because relationships were not imported after fetching timelines
This commit is contained in:
mgabdev 2020-12-22 23:43:31 -05:00
parent a0a701058f
commit 4f5d0f1b96
1 changed files with 8 additions and 0 deletions

View File

@ -24,6 +24,13 @@ const parseTags = (tags = {}, mode) => {
return (tags[mode] || []).map((tag) => tag.value)
}
const fetchStatusesAccountsRelationships = (dispatch, statuses) => {
const accountIds = statuses.map(item => item.account.id)
if (accountIds.length > 0) {
dispatch(fetchRelationships(accountIds))
}
}
/**
*
*/
@ -154,6 +161,7 @@ export const expandTimeline = (timelineId, path, params = {}, done = noop) => (d
const next = getLinks(response).refs.find(link => link.rel === 'next')
dispatch(importFetchedStatuses(response.data))
dispatch(expandTimelineSuccess(timelineId, response.data, next ? next.uri : null, response.code === 206, isLoadingRecent, isLoadingMore))
fetchStatusesAccountsRelationships(dispatch, response.data)
done()
}).catch((error) => {
dispatch(expandTimelineFail(timelineId, error, isLoadingMore))