Added MIN_UNAUTHENTICATED_PAGES for pagination of group, explore timelines
• Added: - MIN_UNAUTHENTICATED_PAGES for pagination of group, explore timelines
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
setGroupTimelineSort,
|
||||
} from '../actions/groups'
|
||||
import {
|
||||
MIN_UNAUTHENTICATED_PAGES,
|
||||
GROUP_TIMELINE_SORTING_TYPE_NEWEST,
|
||||
} from '../constants'
|
||||
import StatusList from '../components/status_list'
|
||||
@@ -26,7 +27,7 @@ class GroupTimeline extends ImmutablePureComponent {
|
||||
|
||||
state = {
|
||||
//keep track of page loads for if no user,
|
||||
//only allow 2 page loads before showing sign up msg
|
||||
//only allow MIN_UNAUTHENTICATED_PAGES page loads before showing sign up msg
|
||||
page: 1,
|
||||
}
|
||||
|
||||
@@ -75,7 +76,7 @@ class GroupTimeline extends ImmutablePureComponent {
|
||||
const { page } = this.state
|
||||
|
||||
const newPage = !!maxId ? this.state.page + 1 : 1
|
||||
if (!!maxId && !me && page >= 2) return false
|
||||
if (!!maxId && !me && page >= MIN_UNAUTHENTICATED_PAGES) return false
|
||||
this.setState({ page: newPage })
|
||||
|
||||
const sortBy = getSortBy(sortByValue, sortByTopValue)
|
||||
@@ -102,7 +103,7 @@ class GroupTimeline extends ImmutablePureComponent {
|
||||
return <ColumnIndicator type='missing' />
|
||||
}
|
||||
|
||||
const canLoadMore = page < 2 && !me || !!me
|
||||
const canLoadMore = page < MIN_UNAUTHENTICATED_PAGES && !me || !!me
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
||||
Reference in New Issue
Block a user