Move things around a bit
This commit is contained in:
parent
30b13cbdbc
commit
4aad98256a
5 changed files with 26 additions and 28 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue