]> cat aescling's git repositories - mastodon.git/commitdiff
Fetch relationships when opening report modal
authorClaire <claire.github-309c@sitedethib.com>
Wed, 23 Feb 2022 20:05:46 +0000 (21:05 +0100)
committerClaire <claire.github-309c@sitedethib.com>
Wed, 23 Feb 2022 20:12:03 +0000 (21:12 +0100)
Relationship with the reported account affect which actions are proposed in
the “thanks” part. Upstream fetches relationships when opening dropdown menus,
but we don't.

app/javascript/flavours/glitch/features/ui/components/report_modal.js

index 3e6d77b5dcea97bf3394d8135664702bc97de59a..dcbe94929efab871cddfcef546253a44d4ab7c87 100644 (file)
@@ -3,6 +3,7 @@ import { connect } from 'react-redux';
 import { submitReport } from 'flavours/glitch/actions/reports';
 import { expandAccountTimeline } from 'flavours/glitch/actions/timelines';
 import { fetchRules } from 'flavours/glitch/actions/rules';
+import { fetchRelationships } from 'flavours/glitch/actions/accounts';
 import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import { makeGetAccount } from 'flavours/glitch/selectors';
@@ -116,6 +117,7 @@ class ReportModal extends ImmutablePureComponent {
   componentDidMount () {
     const { dispatch, accountId } = this.props;
 
+    dispatch(fetchRelationships([accountId]));
     dispatch(expandAccountTimeline(accountId, { withReplies: true }));
     dispatch(fetchRules());
   }