Bookmarks: don't update constantly, fixes #263

merge-requests/155/head
Alex Gleason 2020-07-30 00:38:40 -05:00
rodzic 59e2811a49
commit 23e370a10b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 5 dodań i 10 usunięć

Wyświetl plik

@ -6,7 +6,8 @@ import Column from '../ui/components/column';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
import StatusList from '../../components/status_list';
import { fetchBookmarkedStatuses } from '../../actions/bookmarks';
import { fetchBookmarkedStatuses, expandBookmarkedStatuses } from '../../actions/bookmarks';
import { debounce } from 'lodash';
const messages = defineMessages({
heading: { id: 'column.bookmarks', defaultMessage: 'Bookmarks' },
@ -42,15 +43,9 @@ class Bookmarks extends ImmutablePureComponent {
dispatch(fetchBookmarkedStatuses());
}
componentDidUpdate(prevProps) {
const { dispatch } = this.props;
dispatch(fetchBookmarkedStatuses());
}
handleLoadMore = maxId => {
const { dispatch } = this.props;
dispatch(fetchBookmarkedStatuses({ maxId }));
}
handleLoadMore = debounce(() => {
this.props.dispatch(expandBookmarkedStatuses());
}, 300, { leading: true })
render() {