diff --git a/packages/web/components/templates/library/LibraryContainer.tsx b/packages/web/components/templates/library/LibraryContainer.tsx index 60b335ebd..5c1d1a12a 100644 --- a/packages/web/components/templates/library/LibraryContainer.tsx +++ b/packages/web/components/templates/library/LibraryContainer.tsx @@ -675,25 +675,18 @@ export function LibraryContainer(props: LibraryContainerProps): JSX.Element { activeCardId ? [...ACTIVE_ACTIONS, ...UNACTIVE_ACTIONS] : UNACTIVE_ACTIONS, [activeCardId, activeItem] ) - // useFetchMore( - // () => { - // if (!isFetching && !isLoading && hasNextPage) { - // fetchNextPage() - // } - // }, - // () => { - // if (!isFetching && !isLoading && hasPreviousPage) { - // fetchPreviousPage() - // } - // } - // ) - - // console.log( - // 'isFetching && !isLoading, isFetchingNextPage', - // isFetching, - // isLoading, - // isFetchingNextPage - // ) + useFetchMore( + () => { + if (!isFetching && !isLoading && hasNextPage) { + fetchNextPage() + } + }, + () => { + if (!isFetching && !isLoading && hasPreviousPage) { + fetchPreviousPage() + } + } + ) const setIsChecked = useCallback( (itemId: string, set: boolean) => { @@ -810,32 +803,32 @@ export function LibraryContainer(props: LibraryContainerProps): JSX.Element { [itemsPages, multiSelectMode, checkedItems] ) - return ( - Loading...} - endMessage={ - - Yay! You have seen it all - - } - > - {libraryItems.map((item) => { - return ( - { - router.push(`/${viewerData?.profile.username}/${item.node.slug}`) - }} - > - {item.cursor}: {item.node.title} - - ) - })} - - ) + // return ( + // Loading...} + // endMessage={ + // + // Yay! You have seen it all + // + // } + // > + // {libraryItems.map((item) => { + // return ( + // { + // router.push(`/${viewerData?.profile.username}/${item.node.slug}`) + // }} + // > + // {item.cursor}: {item.node.title} + // + // ) + // })} + // + // ) return ( void, - fetchPreviousPage: () => void, + // fetchPreviousPage: () => void, delay = 500 ): void => { const [first, setFirst] = useState(true) @@ -21,10 +21,10 @@ export const useFetchMore = ( scrollTop + clientHeight >= scrollHeight - scrollHeight / 3 ) { fetchNextPage() - } else if (direction == 'up' && scrollTop < 300) { + } /* else if (direction == 'up' && scrollTop < 300) { console.log('calling fetchPrevious: ', scrollTop) fetchPreviousPage() - } + } */ throttleTimeout.current = undefined } @@ -45,5 +45,5 @@ export const useFetchMore = ( return () => { window.removeEventListener('scroll', handleScroll) } - }, [fetchNextPage, fetchPreviousPage, delay, first, setFirst]) + }, [fetchNextPage, /* fetchPreviousPage, */ delay, first, setFirst]) }
- Yay! You have seen it all -
+ // Yay! You have seen it all + //