From 5998f52e9f2e60a3b51ed7b91af55201a139bf54 Mon Sep 17 00:00:00 2001 From: Mary Kate Date: Mon, 10 Aug 2020 12:08:32 -0500 Subject: [PATCH] fix relationship not loading on hover card --- .../profile_hover_card_container.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/soapbox/features/profile_hover_card/profile_hover_card_container.js b/app/soapbox/features/profile_hover_card/profile_hover_card_container.js index 9ab2c7678..8cd4e94e6 100644 --- a/app/soapbox/features/profile_hover_card/profile_hover_card_container.js +++ b/app/soapbox/features/profile_hover_card/profile_hover_card_container.js @@ -10,6 +10,7 @@ import ActionButton from '../ui/components/action_button'; import { isAdmin, isModerator } from 'soapbox/utils/accounts'; import Badge from 'soapbox/components/badge'; import classNames from 'classnames'; +import { fetchRelationships } from 'soapbox/actions/accounts'; const getAccount = makeGetAccount(); @@ -19,11 +20,7 @@ const mapStateToProps = (state, { accountId }) => { }; }; -const mapDispatchToProps = (dispatch) => ({ - -}); - -export default @connect(mapStateToProps, mapDispatchToProps) +export default @connect(mapStateToProps) @injectIntl class ProfileHoverCardContainer extends ImmutablePureComponent { @@ -32,6 +29,7 @@ class ProfileHoverCardContainer extends ImmutablePureComponent { accountId: PropTypes.string, account: ImmutablePropTypes.map, intl: PropTypes.object.isRequired, + dispatch: PropTypes.func.isRequired, } static defaultProps = { @@ -47,6 +45,10 @@ class ProfileHoverCardContainer extends ImmutablePureComponent { return badges; } + componentDidMount() { + this.props.dispatch(fetchRelationships([this.props.accountId])); + } + render() { const { visible, accountId, account } = this.props; if (!accountId) return null;