about summary refs log tree commit diff
path: root/app/assets/javascripts/components/features
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-30 15:06:43 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-10-30 15:06:43 +0100
commite8ff4c8e56650bf061c63a7da3d84b742e618b6a (patch)
treecb9aa48393bc6108655db7490434ae29d3145ee5 /app/assets/javascripts/components/features
parent7060bdf04bde59aab9addce95f00d6e1075a62ba (diff)
Refactoring redux state into different reducers
Diffstat (limited to 'app/assets/javascripts/components/features')
-rw-r--r--app/assets/javascripts/components/features/account/index.jsx2
-rw-r--r--app/assets/javascripts/components/features/account_timeline/index.jsx2
-rw-r--r--app/assets/javascripts/components/features/compose/containers/suggestions_container.jsx2
-rw-r--r--app/assets/javascripts/components/features/followers/containers/account_container.jsx2
-rw-r--r--app/assets/javascripts/components/features/status/index.jsx10
-rw-r--r--app/assets/javascripts/components/features/ui/containers/navigation_container.jsx2
6 files changed, 10 insertions, 10 deletions
diff --git a/app/assets/javascripts/components/features/account/index.jsx b/app/assets/javascripts/components/features/account/index.jsx
index 548f7fc1f..6cadcff4d 100644
--- a/app/assets/javascripts/components/features/account/index.jsx
+++ b/app/assets/javascripts/components/features/account/index.jsx
@@ -26,7 +26,7 @@ const makeMapStateToProps = () => {
 
   const mapStateToProps = (state, props) => ({
     account: getAccount(state, Number(props.params.accountId)),
-    me: state.getIn(['timelines', 'me'])
+    me: state.getIn(['meta', 'me'])
   });
 
   return mapStateToProps;
diff --git a/app/assets/javascripts/components/features/account_timeline/index.jsx b/app/assets/javascripts/components/features/account_timeline/index.jsx
index f79570361..cae88efdb 100644
--- a/app/assets/javascripts/components/features/account_timeline/index.jsx
+++ b/app/assets/javascripts/components/features/account_timeline/index.jsx
@@ -10,7 +10,7 @@ import LoadingIndicator       from '../../components/loading_indicator';
 
 const mapStateToProps = (state, props) => ({
   statusIds: state.getIn(['timelines', 'accounts_timelines', Number(props.params.accountId)]),
-  me: state.getIn(['timelines', 'me'])
+  me: state.getIn(['meta', 'me'])
 });
 
 const AccountTimeline = React.createClass({
diff --git a/app/assets/javascripts/components/features/compose/containers/suggestions_container.jsx b/app/assets/javascripts/components/features/compose/containers/suggestions_container.jsx
index 12ee1ebc2..944ceed85 100644
--- a/app/assets/javascripts/components/features/compose/containers/suggestions_container.jsx
+++ b/app/assets/javascripts/components/features/compose/containers/suggestions_container.jsx
@@ -2,7 +2,7 @@ import { connect }           from 'react-redux';
 import SuggestionsBox        from '../components/suggestions_box';
 
 const mapStateToProps = (state) => ({
-  accountIds: state.get('suggestions')
+  accountIds: state.getIn(['user_lists', 'suggestions'])
 });
 
 export default connect(mapStateToProps)(SuggestionsBox);
diff --git a/app/assets/javascripts/components/features/followers/containers/account_container.jsx b/app/assets/javascripts/components/features/followers/containers/account_container.jsx
index 988d60adb..c5d5c5881 100644
--- a/app/assets/javascripts/components/features/followers/containers/account_container.jsx
+++ b/app/assets/javascripts/components/features/followers/containers/account_container.jsx
@@ -11,7 +11,7 @@ const makeMapStateToProps = () => {
 
   const mapStateToProps = (state, props) => ({
     account: getAccount(state, props.id),
-    me: state.getIn(['timelines', 'me'])
+    me: state.getIn(['meta', 'me'])
   });
 
   return mapStateToProps;
diff --git a/app/assets/javascripts/components/features/status/index.jsx b/app/assets/javascripts/components/features/status/index.jsx
index dc29a87c7..78498039c 100644
--- a/app/assets/javascripts/components/features/status/index.jsx
+++ b/app/assets/javascripts/components/features/status/index.jsx
@@ -31,7 +31,7 @@ const makeMapStateToProps = () => {
     status: getStatus(state, Number(props.params.statusId)),
     ancestorsIds: state.getIn(['timelines', 'ancestors', Number(props.params.statusId)]),
     descendantsIds: state.getIn(['timelines', 'descendants', Number(props.params.statusId)]),
-    me: state.getIn(['timelines', 'me'])
+    me: state.getIn(['meta', 'me'])
   });
 
   return mapStateToProps;
@@ -43,8 +43,8 @@ const Status = React.createClass({
     params: React.PropTypes.object.isRequired,
     dispatch: React.PropTypes.func.isRequired,
     status: ImmutablePropTypes.map,
-    ancestorsIds: ImmutablePropTypes.orderedSet,
-    descendantsIds: ImmutablePropTypes.orderedSet
+    ancestorsIds: ImmutablePropTypes.list,
+    descendantsIds: ImmutablePropTypes.list
   },
 
   mixins: [PureRenderMixin],
@@ -101,11 +101,11 @@ const Status = React.createClass({
 
     const account = status.get('account');
 
-    if (ancestorsIds) {
+    if (ancestorsIds && ancestorsIds.size > 0) {
       ancestors = <div>{this.renderChildren(ancestorsIds)}</div>;
     }
 
-    if (descendantsIds) {
+    if (descendantsIds && descendantsIds.size > 0) {
       descendants = <div>{this.renderChildren(descendantsIds)}</div>;
     }
 
diff --git a/app/assets/javascripts/components/features/ui/containers/navigation_container.jsx b/app/assets/javascripts/components/features/ui/containers/navigation_container.jsx
index 4aeea4c37..51e2513d8 100644
--- a/app/assets/javascripts/components/features/ui/containers/navigation_container.jsx
+++ b/app/assets/javascripts/components/features/ui/containers/navigation_container.jsx
@@ -2,7 +2,7 @@ import { connect }   from 'react-redux';
 import NavigationBar from '../components/navigation_bar';
 
 const mapStateToProps = (state, props) => ({
-  account: state.getIn(['timelines', 'accounts', state.getIn(['timelines', 'me'])])
+  account: state.getIn(['accounts', state.getIn(['meta', 'me'])])
 });
 
 export default connect(mapStateToProps)(NavigationBar);