Allow clients to fetch statuses made while they were offline (#6876)
This commit is contained in:
parent
59657e24b9
commit
9a1a55ce52
22 changed files with 191 additions and 259 deletions
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { changeReportComment, changeReportForward, submitReport } from '../../../actions/reports';
|
||||
import { refreshAccountTimeline } from '../../../actions/timelines';
|
||||
import { expandAccountTimeline } from '../../../actions/timelines';
|
||||
import PropTypes from 'prop-types';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { makeGetAccount } from '../../../selectors';
|
||||
|
@ -64,12 +64,12 @@ export default class ReportModal extends ImmutablePureComponent {
|
|||
}
|
||||
|
||||
componentDidMount () {
|
||||
this.props.dispatch(refreshAccountTimeline(this.props.account.get('id')));
|
||||
this.props.dispatch(expandAccountTimeline(this.props.account.get('id')));
|
||||
}
|
||||
|
||||
componentWillReceiveProps (nextProps) {
|
||||
if (this.props.account !== nextProps.account && nextProps.account) {
|
||||
this.props.dispatch(refreshAccountTimeline(nextProps.account.get('id')));
|
||||
this.props.dispatch(expandAccountTimeline(nextProps.account.get('id')));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,15 +48,13 @@ const makeMapStateToProps = () => {
|
|||
statusIds: getStatusIds(state, { type: timelineId }),
|
||||
isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true),
|
||||
isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false),
|
||||
hasMore: !!state.getIn(['timelines', timelineId, 'next']),
|
||||
hasMore: state.getIn(['timelines', timelineId, 'hasMore']),
|
||||
});
|
||||
|
||||
return mapStateToProps;
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch, { timelineId, loadMore }) => ({
|
||||
|
||||
onLoadMore: debounce(loadMore, 300, { leading: true }),
|
||||
const mapDispatchToProps = (dispatch, { timelineId }) => ({
|
||||
|
||||
onScrollToTop: debounce(() => {
|
||||
dispatch(scrollTopTimeline(timelineId, true));
|
||||
|
|
|
@ -10,7 +10,7 @@ import { Redirect, withRouter } from 'react-router-dom';
|
|||
import { isMobile } from '../../is_mobile';
|
||||
import { debounce } from 'lodash';
|
||||
import { uploadCompose, resetCompose } from '../../actions/compose';
|
||||
import { refreshHomeTimeline } from '../../actions/timelines';
|
||||
import { expandHomeTimeline } from '../../actions/timelines';
|
||||
import { refreshNotifications } from '../../actions/notifications';
|
||||
import { clearHeight } from '../../actions/height_cache';
|
||||
import { WrappedSwitch, WrappedRoute } from './util/react_router_helpers';
|
||||
|
@ -284,7 +284,7 @@ export default class UI extends React.PureComponent {
|
|||
navigator.serviceWorker.addEventListener('message', this.handleServiceWorkerPostMessage);
|
||||
}
|
||||
|
||||
this.props.dispatch(refreshHomeTimeline());
|
||||
this.props.dispatch(expandHomeTimeline());
|
||||
this.props.dispatch(refreshNotifications());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue