mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): endless gallery scroll
This commit is contained in:
parent
b0557aa16b
commit
350ffecc1f
@ -170,6 +170,14 @@ const ImageGalleryContent = () => {
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleEndReached = useCallback(() => {
|
||||||
|
if (currentCategory === 'results') {
|
||||||
|
dispatch(receivedResultImagesPage());
|
||||||
|
} else if (currentCategory === 'uploads') {
|
||||||
|
dispatch(receivedUploadImagesPage());
|
||||||
|
}
|
||||||
|
}, [dispatch, currentCategory]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex flexDirection="column" w="full" h="full" gap={4}>
|
<Flex flexDirection="column" w="full" h="full" gap={4}>
|
||||||
<Flex
|
<Flex
|
||||||
@ -310,6 +318,7 @@ const ImageGalleryContent = () => {
|
|||||||
<VirtuosoGrid
|
<VirtuosoGrid
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
data={images}
|
data={images}
|
||||||
|
endReached={handleEndReached}
|
||||||
components={{
|
components={{
|
||||||
Item: ItemContainer,
|
Item: ItemContainer,
|
||||||
List: ListContainer,
|
List: ListContainer,
|
||||||
|
Loading…
Reference in New Issue
Block a user