about summary refs log tree commit diff
path: root/app/assets/javascripts/components/features
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-24 04:12:10 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-24 04:12:10 +0100
commitd9022884c6c4e066b1e6ee8d9c07c220c031454e (patch)
treed3d7904c6dabcdee0f6afd8e5a64cff9d4d329ee /app/assets/javascripts/components/features
parent1761d3f9c33f3e2e98a09906fae1a03783b54b10 (diff)
Smarter infinite scroll
Diffstat (limited to 'app/assets/javascripts/components/features')
-rw-r--r--app/assets/javascripts/components/features/account_timeline/index.jsx8
-rw-r--r--app/assets/javascripts/components/features/ui/containers/status_list_container.jsx3
2 files changed, 7 insertions, 4 deletions
diff --git a/app/assets/javascripts/components/features/account_timeline/index.jsx b/app/assets/javascripts/components/features/account_timeline/index.jsx
index 4a66dbbf5..5c09839f7 100644
--- a/app/assets/javascripts/components/features/account_timeline/index.jsx
+++ b/app/assets/javascripts/components/features/account_timeline/index.jsx
@@ -9,7 +9,8 @@ import StatusList from '../../components/status_list';
 import LoadingIndicator from '../../components/loading_indicator';
 
 const mapStateToProps = (state, props) => ({
-  statusIds: state.getIn(['timelines', 'accounts_timelines', Number(props.params.accountId)]),
+  statusIds: state.getIn(['timelines', 'accounts_timelines', Number(props.params.accountId), 'items']),
+  isLoading: state.getIn(['timelines', 'accounts_timelines', Number(props.params.accountId), 'isLoading']),
   me: state.getIn(['meta', 'me'])
 });
 
@@ -19,6 +20,7 @@ const AccountTimeline = React.createClass({
     params: React.PropTypes.object.isRequired,
     dispatch: React.PropTypes.func.isRequired,
     statusIds: ImmutablePropTypes.list,
+    isLoading: React.PropTypes.bool,
     me: React.PropTypes.number.isRequired
   },
 
@@ -39,13 +41,13 @@ const AccountTimeline = React.createClass({
   },
 
   render () {
-    const { statusIds, me } = this.props;
+    const { statusIds, isLoading, me } = this.props;
 
     if (!statusIds) {
       return <LoadingIndicator />;
     }
 
-    return <StatusList statusIds={statusIds} me={me} onScrollToBottom={this.handleScrollToBottom} />
+    return <StatusList statusIds={statusIds} isLoading={isLoading} me={me} onScrollToBottom={this.handleScrollToBottom} />
   }
 
 });
diff --git a/app/assets/javascripts/components/features/ui/containers/status_list_container.jsx b/app/assets/javascripts/components/features/ui/containers/status_list_container.jsx
index ffb6f6e79..8af7b0c3c 100644
--- a/app/assets/javascripts/components/features/ui/containers/status_list_container.jsx
+++ b/app/assets/javascripts/components/features/ui/containers/status_list_container.jsx
@@ -33,7 +33,8 @@ const getStatusIds = createSelector([
 }));
 
 const mapStateToProps = (state, props) => ({
-  statusIds: getStatusIds(state, props)
+  statusIds: getStatusIds(state, props),
+  isLoading: state.getIn(['timelines', props.type, 'isLoading'], true)
 });
 
 const mapDispatchToProps = (dispatch, { type, id }) => ({