Skip to content

Commit 53639a3

Browse files
authored
Fix mutes, blocks, domain blocks and follow requests not paginating (mastodon#10057)
Regression from mastodon#9581
1 parent cdbd893 commit 53639a3

4 files changed

Lines changed: 16 additions & 4 deletions

File tree

app/javascript/mastodon/features/blocks/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const messages = defineMessages({
1818

1919
const mapStateToProps = state => ({
2020
accountIds: state.getIn(['user_lists', 'blocks', 'items']),
21+
hasMore: !!state.getIn(['user_lists', 'blocks', 'next']),
2122
});
2223

2324
export default @connect(mapStateToProps)
@@ -29,6 +30,7 @@ class Blocks extends ImmutablePureComponent {
2930
dispatch: PropTypes.func.isRequired,
3031
shouldUpdateScroll: PropTypes.func,
3132
accountIds: ImmutablePropTypes.list,
33+
hasMore: PropTypes.bool,
3234
intl: PropTypes.object.isRequired,
3335
};
3436

@@ -41,7 +43,7 @@ class Blocks extends ImmutablePureComponent {
4143
}, 300, { leading: true });
4244

4345
render () {
44-
const { intl, accountIds, shouldUpdateScroll } = this.props;
46+
const { intl, accountIds, shouldUpdateScroll, hasMore } = this.props;
4547

4648
if (!accountIds) {
4749
return (
@@ -59,6 +61,7 @@ class Blocks extends ImmutablePureComponent {
5961
<ScrollableList
6062
scrollKey='blocks'
6163
onLoadMore={this.handleLoadMore}
64+
hasMore={hasMore}
6265
shouldUpdateScroll={shouldUpdateScroll}
6366
emptyMessage={emptyMessage}
6467
>

app/javascript/mastodon/features/domain_blocks/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const messages = defineMessages({
1919

2020
const mapStateToProps = state => ({
2121
domains: state.getIn(['domain_lists', 'blocks', 'items']),
22+
hasMore: !!state.getIn(['domain_lists', 'blocks', 'next']),
2223
});
2324

2425
export default @connect(mapStateToProps)
@@ -29,6 +30,7 @@ class Blocks extends ImmutablePureComponent {
2930
params: PropTypes.object.isRequired,
3031
dispatch: PropTypes.func.isRequired,
3132
shouldUpdateScroll: PropTypes.func,
33+
hasMore: PropTypes.bool,
3234
domains: ImmutablePropTypes.orderedSet,
3335
intl: PropTypes.object.isRequired,
3436
};
@@ -42,7 +44,7 @@ class Blocks extends ImmutablePureComponent {
4244
}, 300, { leading: true });
4345

4446
render () {
45-
const { intl, domains, shouldUpdateScroll } = this.props;
47+
const { intl, domains, shouldUpdateScroll, hasMore } = this.props;
4648

4749
if (!domains) {
4850
return (
@@ -60,6 +62,7 @@ class Blocks extends ImmutablePureComponent {
6062
<ScrollableList
6163
scrollKey='domain_blocks'
6264
onLoadMore={this.handleLoadMore}
65+
hasMore={hasMore}
6366
shouldUpdateScroll={shouldUpdateScroll}
6467
emptyMessage={emptyMessage}
6568
>

app/javascript/mastodon/features/follow_requests/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const messages = defineMessages({
1818

1919
const mapStateToProps = state => ({
2020
accountIds: state.getIn(['user_lists', 'follow_requests', 'items']),
21+
hasMore: !!state.getIn(['user_lists', 'follow_requests', 'next']),
2122
});
2223

2324
export default @connect(mapStateToProps)
@@ -28,6 +29,7 @@ class FollowRequests extends ImmutablePureComponent {
2829
params: PropTypes.object.isRequired,
2930
dispatch: PropTypes.func.isRequired,
3031
shouldUpdateScroll: PropTypes.func,
32+
hasMore: PropTypes.bool,
3133
accountIds: ImmutablePropTypes.list,
3234
intl: PropTypes.object.isRequired,
3335
};
@@ -41,7 +43,7 @@ class FollowRequests extends ImmutablePureComponent {
4143
}, 300, { leading: true });
4244

4345
render () {
44-
const { intl, shouldUpdateScroll, accountIds } = this.props;
46+
const { intl, shouldUpdateScroll, accountIds, hasMore } = this.props;
4547

4648
if (!accountIds) {
4749
return (
@@ -59,6 +61,7 @@ class FollowRequests extends ImmutablePureComponent {
5961
<ScrollableList
6062
scrollKey='follow_requests'
6163
onLoadMore={this.handleLoadMore}
64+
hasMore={hasMore}
6265
shouldUpdateScroll={shouldUpdateScroll}
6366
emptyMessage={emptyMessage}
6467
>

app/javascript/mastodon/features/mutes/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const messages = defineMessages({
1818

1919
const mapStateToProps = state => ({
2020
accountIds: state.getIn(['user_lists', 'mutes', 'items']),
21+
hasMore: !!state.getIn(['user_lists', 'mutes', 'next']),
2122
});
2223

2324
export default @connect(mapStateToProps)
@@ -28,6 +29,7 @@ class Mutes extends ImmutablePureComponent {
2829
params: PropTypes.object.isRequired,
2930
dispatch: PropTypes.func.isRequired,
3031
shouldUpdateScroll: PropTypes.func,
32+
hasMore: PropTypes.bool,
3133
accountIds: ImmutablePropTypes.list,
3234
intl: PropTypes.object.isRequired,
3335
};
@@ -41,7 +43,7 @@ class Mutes extends ImmutablePureComponent {
4143
}, 300, { leading: true });
4244

4345
render () {
44-
const { intl, shouldUpdateScroll, accountIds } = this.props;
46+
const { intl, shouldUpdateScroll, hasMore, accountIds } = this.props;
4547

4648
if (!accountIds) {
4749
return (
@@ -59,6 +61,7 @@ class Mutes extends ImmutablePureComponent {
5961
<ScrollableList
6062
scrollKey='mutes'
6163
onLoadMore={this.handleLoadMore}
64+
hasMore={hasMore}
6265
shouldUpdateScroll={shouldUpdateScroll}
6366
emptyMessage={emptyMessage}
6467
>

0 commit comments

Comments
 (0)