diff options
Diffstat (limited to 'app/javascript/mastodon/features/ui')
-rw-r--r-- | app/javascript/mastodon/features/ui/containers/status_list_container.js | 24 | ||||
-rw-r--r-- | app/javascript/mastodon/features/ui/index.js | 4 |
2 files changed, 13 insertions, 15 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 cbdd2d12d..8d8dc9ba9 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 { expandTimeline, scrollTopTimeline } from '../../../actions/timelines'; +import { scrollTopTimeline } from '../../../actions/timelines'; import Immutable from 'immutable'; import { createSelector } from 'reselect'; import { debounce } from 'lodash'; @@ -39,31 +39,29 @@ const makeGetStatusIds = () => createSelector([ const makeMapStateToProps = () => { const getStatusIds = makeGetStatusIds(); - const mapStateToProps = (state, props) => ({ - scrollKey: props.scrollKey, - shouldUpdateScroll: props.shouldUpdateScroll, - statusIds: getStatusIds(state, props), - isLoading: state.getIn(['timelines', props.type, 'isLoading'], true), - isUnread: state.getIn(['timelines', props.type, 'unread']) > 0, - hasMore: !!state.getIn(['timelines', props.type, 'next']), + const mapStateToProps = (state, { timelineId }) => ({ + statusIds: getStatusIds(state, { type: timelineId }), + isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true), + isUnread: state.getIn(['timelines', timelineId, 'unread']) > 0, + hasMore: !!state.getIn(['timelines', timelineId, 'next']), }); return mapStateToProps; }; -const mapDispatchToProps = (dispatch, { type, id }) => ({ +const mapDispatchToProps = (dispatch, { timelineId, loadMore }) => ({ onScrollToBottom: debounce(() => { - dispatch(scrollTopTimeline(type, false)); - dispatch(expandTimeline(type, id)); + dispatch(scrollTopTimeline(timelineId, false)); + loadMore(); }, 300, { leading: true }), onScrollToTop: debounce(() => { - dispatch(scrollTopTimeline(type, true)); + dispatch(scrollTopTimeline(timelineId, true)); }, 100), onScroll: debounce(() => { - dispatch(scrollTopTimeline(type, false)); + dispatch(scrollTopTimeline(timelineId, false)); }, 100), }); diff --git a/app/javascript/mastodon/features/ui/index.js b/app/javascript/mastodon/features/ui/index.js index 5e70c888c..fe775b434 100644 --- a/app/javascript/mastodon/features/ui/index.js +++ b/app/javascript/mastodon/features/ui/index.js @@ -8,7 +8,7 @@ import { connect } from 'react-redux'; import { isMobile } from '../../is_mobile'; import { debounce } from 'lodash'; import { uploadCompose } from '../../actions/compose'; -import { refreshTimeline } from '../../actions/timelines'; +import { refreshHomeTimeline } from '../../actions/timelines'; import { refreshNotifications } from '../../actions/notifications'; import UploadArea from './components/upload_area'; import ColumnsAreaContainer from './containers/columns_area_container'; @@ -95,7 +95,7 @@ class UI extends React.PureComponent { document.addEventListener('dragleave', this.handleDragLeave, false); document.addEventListener('dragend', this.handleDragEnd, false); - this.props.dispatch(refreshTimeline('home')); + this.props.dispatch(refreshHomeTimeline()); this.props.dispatch(refreshNotifications()); } |