Fix Notifications pagination
This commit is contained in:
parent
006e253e23
commit
da17214a0b
1 changed files with 4 additions and 2 deletions
|
@ -156,16 +156,18 @@ class Notifications extends React.PureComponent {
|
||||||
? (<FilterBarContainer />)
|
? (<FilterBarContainer />)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
const showLoading = isLoading && !notifications || notifications.isEmpty();
|
||||||
|
|
||||||
const scrollContainer = (
|
const scrollContainer = (
|
||||||
<PullToRefresh onRefresh={this.handleRefresh}>
|
<PullToRefresh onRefresh={this.handleRefresh}>
|
||||||
<Virtuoso
|
<Virtuoso
|
||||||
useWindowScroll
|
useWindowScroll
|
||||||
data={isLoading ? Array(20).fill() : notifications.toArray()}
|
data={showLoading ? Array(20).fill() : notifications.toArray()}
|
||||||
startReached={this.handleScrollToTop}
|
startReached={this.handleScrollToTop}
|
||||||
endReached={this.handleLoadOlder}
|
endReached={this.handleLoadOlder}
|
||||||
isScrolling={isScrolling => isScrolling && this.handleScroll()}
|
isScrolling={isScrolling => isScrolling && this.handleScroll()}
|
||||||
itemContent={(_index, notification) => (
|
itemContent={(_index, notification) => (
|
||||||
isLoading ? (
|
showLoading ? (
|
||||||
<PlaceholderNotification />
|
<PlaceholderNotification />
|
||||||
) : (
|
) : (
|
||||||
<NotificationContainer
|
<NotificationContainer
|
||||||
|
|
Loading…
Reference in a new issue