about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-30 22:35:36 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-30 22:35:36 +0100
commit86b3cb512052b8969e2f259dd784569738efe33f (patch)
tree91b21d41a387387f08dc3f82050775b52d21c206 /app
parentf21e7d6ac06556671c2663ce2879442c60230b32 (diff)
Fix not reloading account/fetching relationship on newly independent components
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/components/features/account_timeline/index.jsx3
-rw-r--r--app/assets/javascripts/components/features/followers/index.jsx3
-rw-r--r--app/assets/javascripts/components/features/following/index.jsx3
3 files changed, 9 insertions, 0 deletions
diff --git a/app/assets/javascripts/components/features/account_timeline/index.jsx b/app/assets/javascripts/components/features/account_timeline/index.jsx
index 6e2356dc1..6613600cc 100644
--- a/app/assets/javascripts/components/features/account_timeline/index.jsx
+++ b/app/assets/javascripts/components/features/account_timeline/index.jsx
@@ -2,6 +2,7 @@ import { connect } from 'react-redux';
 import PureRenderMixin from 'react-addons-pure-render-mixin';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import {
+  fetchAccount,
   fetchAccountTimeline,
   expandAccountTimeline
 } from '../../actions/accounts';
@@ -30,11 +31,13 @@ const AccountTimeline = React.createClass({
   mixins: [PureRenderMixin],
 
   componentWillMount () {
+    this.props.dispatch(fetchAccount(Number(this.props.params.accountId)));
     this.props.dispatch(fetchAccountTimeline(Number(this.props.params.accountId)));
   },
 
   componentWillReceiveProps(nextProps) {
     if (nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) {
+      this.props.dispatch(fetchAccount(Number(nextProps.params.accountId)));
       this.props.dispatch(fetchAccountTimeline(Number(nextProps.params.accountId)));
     }
   },
diff --git a/app/assets/javascripts/components/features/followers/index.jsx b/app/assets/javascripts/components/features/followers/index.jsx
index b96516813..1b9548c7e 100644
--- a/app/assets/javascripts/components/features/followers/index.jsx
+++ b/app/assets/javascripts/components/features/followers/index.jsx
@@ -3,6 +3,7 @@ import PureRenderMixin from 'react-addons-pure-render-mixin';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import LoadingIndicator from '../../components/loading_indicator';
 import {
+  fetchAccount,
   fetchFollowers,
   expandFollowers
 } from '../../actions/accounts';
@@ -28,11 +29,13 @@ const Followers = React.createClass({
   mixins: [PureRenderMixin],
 
   componentWillMount () {
+    this.props.dispatch(fetchAccount(Number(this.props.params.accountId)));
     this.props.dispatch(fetchFollowers(Number(this.props.params.accountId)));
   },
 
   componentWillReceiveProps(nextProps) {
     if (nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) {
+      this.props.dispatch(fetchAccount(Number(nextProps.params.accountId)));
       this.props.dispatch(fetchFollowers(Number(nextProps.params.accountId)));
     }
   },
diff --git a/app/assets/javascripts/components/features/following/index.jsx b/app/assets/javascripts/components/features/following/index.jsx
index 559911a7d..2a799ac42 100644
--- a/app/assets/javascripts/components/features/following/index.jsx
+++ b/app/assets/javascripts/components/features/following/index.jsx
@@ -3,6 +3,7 @@ import PureRenderMixin from 'react-addons-pure-render-mixin';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import LoadingIndicator from '../../components/loading_indicator';
 import {
+  fetchAccount,
   fetchFollowing,
   expandFollowing
 } from '../../actions/accounts';
@@ -28,11 +29,13 @@ const Following = React.createClass({
   mixins: [PureRenderMixin],
 
   componentWillMount () {
+    this.props.dispatch(fetchAccount(Number(this.props.params.accountId)));
     this.props.dispatch(fetchFollowing(Number(this.props.params.accountId)));
   },
 
   componentWillReceiveProps(nextProps) {
     if (nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) {
+      this.props.dispatch(fetchAccount(Number(nextProps.params.accountId)));
       this.props.dispatch(fetchFollowing(Number(nextProps.params.accountId)));
     }
   },