[Glitch] Allow clients to fetch statuses made while they were offline

Port 9a1a55ce52 to glitch-soc
This commit is contained in:
Thibaut Girka
2018-05-27 19:10:37 +02:00
committed by ThibG
parent 532fb8e215
commit 0ad3eedd4c
21 changed files with 195 additions and 261 deletions

View File

@@ -2,10 +2,7 @@ import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container';
import {
refreshCommunityTimeline,
expandCommunityTimeline,
} from 'flavours/glitch/actions/timelines';
import { expandCommunityTimeline } from 'flavours/glitch/actions/timelines';
import Column from 'flavours/glitch/components/column';
import ColumnHeader from 'flavours/glitch/components/column_header';
import { defineMessages, injectIntl } from 'react-intl';
@@ -35,7 +32,7 @@ export default class CommunityTimeline extends React.PureComponent {
componentDidMount () {
const { dispatch } = this.props;
dispatch(refreshCommunityTimeline());
dispatch(expandCommunityTimeline());
this.disconnect = dispatch(connectCommunityStream());
}
@@ -46,8 +43,8 @@ export default class CommunityTimeline extends React.PureComponent {
}
}
handleLoadMore = () => {
this.props.dispatch(expandCommunityTimeline());
handleLoadMore = maxId => {
this.props.dispatch(expandCommunityTimeline({ maxId }));
}
render () {
@@ -63,7 +60,7 @@ export default class CommunityTimeline extends React.PureComponent {
<StatusListContainer
timelineId='community'
loadMore={this.handleLoadMore}
onLoadMore={this.handleLoadMore}
scrollKey='standalone_public_timeline'
trackScroll={false}
/>

View File

@@ -2,10 +2,7 @@ import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container';
import {
refreshHashtagTimeline,
expandHashtagTimeline,
} from 'flavours/glitch/actions/timelines';
import { expandHashtagTimeline } from 'flavours/glitch/actions/timelines';
import Column from 'flavours/glitch/components/column';
import ColumnHeader from 'flavours/glitch/components/column_header';
import { connectHashtagStream } from 'flavours/glitch/actions/streaming';
@@ -29,7 +26,7 @@ export default class HashtagTimeline extends React.PureComponent {
componentDidMount () {
const { dispatch, hashtag } = this.props;
dispatch(refreshHashtagTimeline(hashtag));
dispatch(expandHashtagTimeline(hashtag));
this.disconnect = dispatch(connectHashtagStream(hashtag));
}
@@ -40,8 +37,8 @@ export default class HashtagTimeline extends React.PureComponent {
}
}
handleLoadMore = () => {
this.props.dispatch(expandHashtagTimeline(this.props.hashtag));
handleLoadMore = maxId => {
this.props.dispatch(expandHashtagTimeline(this.props.hashtag, { maxId }));
}
render () {
@@ -59,7 +56,7 @@ export default class HashtagTimeline extends React.PureComponent {
trackScroll={false}
scrollKey='standalone_hashtag_timeline'
timelineId={`hashtag:${hashtag}`}
loadMore={this.handleLoadMore}
onLoadMore={this.handleLoadMore}
/>
</Column>
);

View File

@@ -2,10 +2,7 @@ import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container';
import {
refreshPublicTimeline,
expandPublicTimeline,
} from 'flavours/glitch/actions/timelines';
import { expandPublicTimeline } from 'flavours/glitch/actions/timelines';
import Column from 'flavours/glitch/components/column';
import ColumnHeader from 'flavours/glitch/components/column_header';
import { defineMessages, injectIntl } from 'react-intl';
@@ -35,7 +32,7 @@ export default class PublicTimeline extends React.PureComponent {
componentDidMount () {
const { dispatch } = this.props;
dispatch(refreshPublicTimeline());
dispatch(expandPublicTimeline());
this.disconnect = dispatch(connectPublicStream());
}
@@ -46,8 +43,8 @@ export default class PublicTimeline extends React.PureComponent {
}
}
handleLoadMore = () => {
this.props.dispatch(expandPublicTimeline());
handleLoadMore = maxId => {
this.props.dispatch(expandPublicTimeline({ maxId }));
}
render () {
@@ -63,7 +60,7 @@ export default class PublicTimeline extends React.PureComponent {
<StatusListContainer
timelineId='public'
loadMore={this.handleLoadMore}
onLoadMore={this.handleLoadMore}
scrollKey='standalone_public_timeline'
trackScroll={false}
/>