[Glitch] Add option to disable real-time updates in web UI

Port 729723f857 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
Eugen Rochko
2019-07-16 06:30:47 +02:00
committed by Thibaut Girka
parent c8a47595fb
commit e91bf82083
12 changed files with 154 additions and 51 deletions

View File

@@ -1,6 +1,6 @@
import { connect } from 'react-redux';
import StatusList from 'flavours/glitch/components/status_list';
import { scrollTopTimeline } from 'flavours/glitch/actions/timelines';
import { scrollTopTimeline, loadPending } from 'flavours/glitch/actions/timelines';
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
import { createSelector } from 'reselect';
import { debounce } from 'lodash';
@@ -62,6 +62,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;
@@ -77,6 +78,8 @@ const mapDispatchToProps = (dispatch, { timelineId }) => ({
dispatch(scrollTopTimeline(timelineId, false));
}, 100),
onLoadPending: () => dispatch(loadPending(timelineId)),
});
export default connect(makeMapStateToProps, mapDispatchToProps)(StatusList);