[Glitch] Replace onScrollToBottom with onLoadMore
Port b0664a5e6c to glitch-soc
This commit is contained in:
@@ -56,7 +56,7 @@ export default class AccountTimeline extends ImmutablePureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
handleScrollToBottom = () => {
|
||||
handleLoadMore = () => {
|
||||
if (!this.props.isLoading && this.props.hasMore) {
|
||||
this.props.dispatch(expandAccountTimeline(this.props.params.accountId, this.props.withReplies));
|
||||
}
|
||||
@@ -84,7 +84,7 @@ export default class AccountTimeline extends ImmutablePureComponent {
|
||||
featuredStatusIds={featuredStatusIds}
|
||||
isLoading={isLoading}
|
||||
hasMore={hasMore}
|
||||
onScrollToBottom={this.handleScrollToBottom}
|
||||
onLoadMore={this.handleLoadMore}
|
||||
/>
|
||||
</Column>
|
||||
);
|
||||
|
||||
@@ -62,7 +62,7 @@ export default class Bookmarks extends ImmutablePureComponent {
|
||||
this.column = c;
|
||||
}
|
||||
|
||||
handleScrollToBottom = debounce(() => {
|
||||
handleLoadMore = debounce(() => {
|
||||
this.props.dispatch(expandBookmarkedStatuses());
|
||||
}, 300, { leading: true })
|
||||
|
||||
@@ -89,7 +89,7 @@ export default class Bookmarks extends ImmutablePureComponent {
|
||||
scrollKey={`bookmarked_statuses-${columnId}`}
|
||||
hasMore={hasMore}
|
||||
isLoading={isLoading}
|
||||
onScrollToBottom={this.handleScrollToBottom}
|
||||
onLoadMore={this.handleLoadMore}
|
||||
/>
|
||||
</Column>
|
||||
);
|
||||
|
||||
@@ -62,7 +62,7 @@ export default class Favourites extends ImmutablePureComponent {
|
||||
this.column = c;
|
||||
}
|
||||
|
||||
handleScrollToBottom = debounce(() => {
|
||||
handleLoadMore = debounce(() => {
|
||||
this.props.dispatch(expandFavouritedStatuses());
|
||||
}, 300, { leading: true })
|
||||
|
||||
@@ -89,7 +89,7 @@ export default class Favourites extends ImmutablePureComponent {
|
||||
scrollKey={`favourited_statuses-${columnId}`}
|
||||
hasMore={hasMore}
|
||||
isLoading={isLoading}
|
||||
onScrollToBottom={this.handleScrollToBottom}
|
||||
onLoadMore={this.handleLoadMore}
|
||||
/>
|
||||
</Column>
|
||||
);
|
||||
|
||||
@@ -67,7 +67,7 @@ export default class Notifications extends React.PureComponent {
|
||||
trackScroll: true,
|
||||
};
|
||||
|
||||
handleScrollToBottom = debounce(() => {
|
||||
handleLoadMore = debounce(() => {
|
||||
this.props.dispatch(scrollTopNotifications(false));
|
||||
this.props.dispatch(expandNotifications());
|
||||
}, 300, { leading: true });
|
||||
@@ -153,7 +153,7 @@ export default class Notifications extends React.PureComponent {
|
||||
isLoading={isLoading}
|
||||
hasMore={hasMore}
|
||||
emptyMessage={emptyMessage}
|
||||
onScrollToBottom={this.handleScrollToBottom}
|
||||
onLoadMore={this.handleLoadMore}
|
||||
onScrollToTop={this.handleScrollToTop}
|
||||
onScroll={this.handleScroll}
|
||||
shouldUpdateScroll={shouldUpdateScroll}
|
||||
|
||||
@@ -60,10 +60,7 @@ const makeMapStateToProps = () => {
|
||||
|
||||
const mapDispatchToProps = (dispatch, { timelineId, loadMore }) => ({
|
||||
|
||||
onScrollToBottom: debounce(() => {
|
||||
dispatch(scrollTopTimeline(timelineId, false));
|
||||
loadMore();
|
||||
}, 300, { leading: true }),
|
||||
onLoadMore: debounce(loadMore, 300, { leading: true }),
|
||||
|
||||
onScrollToTop: debounce(() => {
|
||||
dispatch(scrollTopTimeline(timelineId, true));
|
||||
|
||||
Reference in New Issue
Block a user