Move things around a bit
This commit is contained in:
@@ -54,8 +54,8 @@ const NotificationList = (props) => {
|
||||
const pageSize = 20;
|
||||
const notifications = props.notifications;
|
||||
const [maxCount, setMaxCount] = useState(pageSize);
|
||||
const count = Math.min(notifications.length, maxCount);
|
||||
|
||||
// Reset state when the list identifier changes, i.e when we switch between subscriptions
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
setMaxCount(pageSize);
|
||||
@@ -63,9 +63,6 @@ const NotificationList = (props) => {
|
||||
}
|
||||
}, [props.id]);
|
||||
|
||||
const count = Math.min(notifications.length, maxCount);
|
||||
console.log(`xxx id=${props.id} scrollMax=${maxCount} count=${count} len=${notifications.length}`)
|
||||
|
||||
return (
|
||||
<InfiniteScroll
|
||||
dataLength={count}
|
||||
|
||||
Reference in New Issue
Block a user