Bookmarks: don't update constantly, fixes #263
This commit is contained in:
parent
59e2811a49
commit
23e370a10b
1 changed files with 5 additions and 10 deletions
|
@ -6,7 +6,8 @@ import Column from '../ui/components/column';
|
||||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
import StatusList from '../../components/status_list';
|
import StatusList from '../../components/status_list';
|
||||||
import { fetchBookmarkedStatuses } from '../../actions/bookmarks';
|
import { fetchBookmarkedStatuses, expandBookmarkedStatuses } from '../../actions/bookmarks';
|
||||||
|
import { debounce } from 'lodash';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
heading: { id: 'column.bookmarks', defaultMessage: 'Bookmarks' },
|
heading: { id: 'column.bookmarks', defaultMessage: 'Bookmarks' },
|
||||||
|
@ -42,15 +43,9 @@ class Bookmarks extends ImmutablePureComponent {
|
||||||
dispatch(fetchBookmarkedStatuses());
|
dispatch(fetchBookmarkedStatuses());
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
handleLoadMore = debounce(() => {
|
||||||
const { dispatch } = this.props;
|
this.props.dispatch(expandBookmarkedStatuses());
|
||||||
dispatch(fetchBookmarkedStatuses());
|
}, 300, { leading: true })
|
||||||
}
|
|
||||||
|
|
||||||
handleLoadMore = maxId => {
|
|
||||||
const { dispatch } = this.props;
|
|
||||||
dispatch(fetchBookmarkedStatuses({ maxId }));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Loading…
Reference in a new issue