[Glitch] Fix mutes, blocks, domain blocks and follow requests not paginating

Port ea7ad59af2  to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
Eugen Rochko
2019-02-16 11:56:09 +01:00
committed by ThibG
parent bd7b1538f1
commit e58af04287
4 changed files with 16 additions and 4 deletions

View File

@ -19,6 +19,7 @@ const messages = defineMessages({
const mapStateToProps = state => ({
domains: state.getIn(['domain_lists', 'blocks', 'items']),
hasMore: !!state.getIn(['domain_lists', 'blocks', 'next']),
});
@connect(mapStateToProps)
@ -28,6 +29,7 @@ export default class Blocks extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired,
hasMore: PropTypes.bool,
domains: ImmutablePropTypes.list,
intl: PropTypes.object.isRequired,
};
@ -41,7 +43,7 @@ export default class Blocks extends ImmutablePureComponent {
}, 300, { leading: true });
render () {
const { intl, domains } = this.props;
const { intl, domains, hasMore } = this.props;
if (!domains) {
return (
@ -59,6 +61,7 @@ export default class Blocks extends ImmutablePureComponent {
<ScrollableList
scrollKey='domain_blocks'
onLoadMore={this.handleLoadMore}
hasMore={hasMore}
emptyMessage={emptyMessage}
>
{domains.map(domain =>