Fix Notifications pagination

This commit is contained in:
Alex Gleason 2022-04-22 13:05:40 -05:00
parent 006e253e23
commit da17214a0b
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -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