Move things around a bit

This commit is contained in:
Philipp Heckel 2022-03-08 11:33:17 -05:00
parent 30b13cbdbc
commit 4aad98256a
5 changed files with 26 additions and 28 deletions

View file

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