about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/ui
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-07-16 06:30:47 +0200
committerGitHub <noreply@github.com>2019-07-16 06:30:47 +0200
commit9b1d3e4acb8190509d98ee4ef2ab9b24b45362ee (patch)
tree2b5b8920929eda9e26c8a4416b43986dbf3f2b01 /app/javascript/mastodon/features/ui
parent4562c3cb7ec0b3b7c232a8d7347623f8e214acd7 (diff)
Add option to disable real-time updates in web UI (#9984)
Fix #9031
Fix #7913
Diffstat (limited to 'app/javascript/mastodon/features/ui')
-rw-r--r--app/javascript/mastodon/features/ui/containers/status_list_container.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/ui/containers/status_list_container.js b/app/javascript/mastodon/features/ui/containers/status_list_container.js
index 3df5b7bea..7b8eb652b 100644
--- a/app/javascript/mastodon/features/ui/containers/status_list_container.js
+++ b/app/javascript/mastodon/features/ui/containers/status_list_container.js
@@ -1,6 +1,6 @@
 import { connect } from 'react-redux';
 import StatusList from '../../../components/status_list';
-import { scrollTopTimeline } from '../../../actions/timelines';
+import { scrollTopTimeline, loadPending } from '../../../actions/timelines';
 import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
 import { createSelector } from 'reselect';
 import { debounce } from 'lodash';
@@ -37,6 +37,7 @@ const makeMapStateToProps = () => {
     isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true),
     isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false),
     hasMore:   state.getIn(['timelines', timelineId, 'hasMore']),
+    numPending: state.getIn(['timelines', timelineId, 'pendingItems'], ImmutableList()).size,
   });
 
   return mapStateToProps;
@@ -52,6 +53,8 @@ const mapDispatchToProps = (dispatch, { timelineId }) => ({
     dispatch(scrollTopTimeline(timelineId, false));
   }, 100),
 
+  onLoadPending: () => dispatch(loadPending(timelineId)),
+
 });
 
 export default connect(makeMapStateToProps, mapDispatchToProps)(StatusList);