From 565cd95bcae1f3814c46191a3f22289313620321 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 3 Dec 2016 21:04:57 +0100 Subject: Keep timelines in the UI trimmed when possible --- .../features/ui/containers/status_list_container.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'app/assets/javascripts/components/features/ui') 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 8004e3f04..1621cec7b 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 @@ -1,16 +1,25 @@ import { connect } from 'react-redux'; import StatusList from '../../../components/status_list'; -import { expandTimeline } from '../../../actions/timelines'; +import { expandTimeline, scrollTopTimeline } from '../../../actions/timelines'; import Immutable from 'immutable'; const mapStateToProps = (state, props) => ({ - statusIds: state.getIn(['timelines', props.type], Immutable.List()) + statusIds: state.getIn(['timelines', props.type, 'items'], Immutable.List()) }); const mapDispatchToProps = function (dispatch, props) { return { onScrollToBottom () { + dispatch(scrollTopTimeline(props.type, false)); dispatch(expandTimeline(props.type, props.id)); + }, + + onScrollToTop () { + dispatch(scrollTopTimeline(props.type, true)); + }, + + onScroll () { + dispatch(scrollTopTimeline(props.type, false)); } }; }; -- cgit