fix relationship not loading on hover card
This commit is contained in:
parent
b30dc39f1a
commit
5998f52e9f
1 changed files with 7 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue