Fix direct timeline

pull/519/head
Thibaut Girka 2018-05-31 14:13:35 +02:00 committed by ThibG
parent e7b3a4263e
commit e396fbfe3b
1 changed files with 5 additions and 8 deletions

View File

@ -4,10 +4,7 @@ import PropTypes from 'prop-types';
import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container'; import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container';
import Column from 'flavours/glitch/components/column'; import Column from 'flavours/glitch/components/column';
import ColumnHeader from 'flavours/glitch/components/column_header'; import ColumnHeader from 'flavours/glitch/components/column_header';
import { import { expandDirectTimeline } from 'flavours/glitch/actions/timelines';
refreshDirectTimeline,
expandDirectTimeline,
} from 'flavours/glitch/actions/timelines';
import { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns'; import { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import ColumnSettingsContainer from './containers/column_settings_container'; import ColumnSettingsContainer from './containers/column_settings_container';
@ -55,7 +52,7 @@ export default class DirectTimeline extends React.PureComponent {
componentDidMount () { componentDidMount () {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch(refreshDirectTimeline()); dispatch(expandDirectTimeline());
this.disconnect = dispatch(connectDirectStream()); this.disconnect = dispatch(connectDirectStream());
} }
@ -70,8 +67,8 @@ export default class DirectTimeline extends React.PureComponent {
this.column = c; this.column = c;
} }
handleLoadMore = () => { handleLoadMore = maxId => {
this.props.dispatch(expandDirectTimeline()); this.props.dispatch(expandDirectTimeline({ maxId }));
} }
render () { render () {
@ -97,7 +94,7 @@ export default class DirectTimeline extends React.PureComponent {
trackScroll={!pinned} trackScroll={!pinned}
scrollKey={`direct_timeline-${columnId}`} scrollKey={`direct_timeline-${columnId}`}
timelineId='direct' timelineId='direct'
loadMore={this.handleLoadMore} onLoadMore={this.handleLoadMore}
emptyMessage={<FormattedMessage id='empty_column.direct' defaultMessage="You don't have any direct messages yet. When you send or receive one, it will show up here." />} emptyMessage={<FormattedMessage id='empty_column.direct' defaultMessage="You don't have any direct messages yet. When you send or receive one, it will show up here." />}
/> />
</Column> </Column>