mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
disable exhaustive-dep bc i dont want it to change when baord changes
This commit is contained in:
parent
067d5b22b2
commit
6be3da4e71
@ -73,19 +73,13 @@ const GalleryImageGrid = () => {
|
|||||||
setLimit(INITIAL_IMAGE_LIMIT);
|
setLimit(INITIAL_IMAGE_LIMIT);
|
||||||
}, [selectedBoardId]);
|
}, [selectedBoardId]);
|
||||||
|
|
||||||
const BASE_QUERY = useMemo(() => {
|
const { data: imageListResponse, isLoading: isLoading } = useListImagesQuery({
|
||||||
return {
|
categories: galleryView === 'images' ? IMAGE_CATEGORIES : ASSETS_CATEGORIES,
|
||||||
categories:
|
is_intermediate: false,
|
||||||
galleryView === 'images' ? IMAGE_CATEGORIES : ASSETS_CATEGORIES,
|
offset: 0,
|
||||||
is_intermediate: false,
|
limit: INITIAL_IMAGE_LIMIT,
|
||||||
offset: 0,
|
...(selectedBoardId === 'all' ? {} : { board_id: selectedBoardId }),
|
||||||
limit: INITIAL_IMAGE_LIMIT,
|
});
|
||||||
...(selectedBoardId === 'all' ? {} : { board_id: selectedBoardId }),
|
|
||||||
};
|
|
||||||
}, [galleryView, selectedBoardId]);
|
|
||||||
|
|
||||||
const { data: imageListResponse, isLoading: isLoading } =
|
|
||||||
useListImagesQuery(BASE_QUERY);
|
|
||||||
|
|
||||||
const { data: paginatedData } = useListImagesQuery(
|
const { data: paginatedData } = useListImagesQuery(
|
||||||
{
|
{
|
||||||
@ -108,7 +102,14 @@ const GalleryImageGrid = () => {
|
|||||||
dispatch(
|
dispatch(
|
||||||
imagesApi.util.updateQueryData(
|
imagesApi.util.updateQueryData(
|
||||||
'listImages',
|
'listImages',
|
||||||
BASE_QUERY,
|
{
|
||||||
|
categories:
|
||||||
|
galleryView === 'images' ? IMAGE_CATEGORIES : ASSETS_CATEGORIES,
|
||||||
|
is_intermediate: false,
|
||||||
|
offset: 0,
|
||||||
|
limit: INITIAL_IMAGE_LIMIT,
|
||||||
|
...(selectedBoardId === 'all' ? {} : { board_id: selectedBoardId }),
|
||||||
|
},
|
||||||
(draftPosts) => {
|
(draftPosts) => {
|
||||||
paginatedData.items.forEach((item) => {
|
paginatedData.items.forEach((item) => {
|
||||||
draftPosts.items.push(item);
|
draftPosts.items.push(item);
|
||||||
@ -117,7 +118,8 @@ const GalleryImageGrid = () => {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, [paginatedData, dispatch, BASE_QUERY]);
|
//eslint-disable-next-line
|
||||||
|
}, [paginatedData, dispatch]);
|
||||||
|
|
||||||
const areMoreAvailable = useMemo(() => {
|
const areMoreAvailable = useMemo(() => {
|
||||||
if (imageListResponse?.total) {
|
if (imageListResponse?.total) {
|
||||||
|
Loading…
Reference in New Issue
Block a user