Skip to content

Commit da59076

Browse files
psychedelicioushipsterusername
authored andcommitted
fix(ui): fix typing of usGalleryImages
For some reason `ReturnType<typeof useListImagesQuery>` isn't working correctly, and destructuring `queryResult` it results in `any`, when the hook is used. I've removed the explicit return typing so that consumers of the hook get correct types.
1 parent 3a9201b commit da59076

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

invokeai/frontend/web/src/features/gallery/hooks/useGalleryImages.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ import {
1111
import { useListImagesQuery } from 'services/api/endpoints/images';
1212
import type { ListImagesArgs } from 'services/api/types';
1313

14-
export type UseGalleryImagesReturn = {
15-
handleLoadMoreImages: () => void;
16-
areMoreImagesAvailable: boolean;
17-
queryResult: ReturnType<typeof useListImagesQuery>;
18-
};
19-
2014
// The gallery is a singleton but multiple components need access to its query data.
2115
// If we don't define the query args outside of the hook, then each component will
2216
// have its own query args and trigger multiple requests. We use an atom to store
@@ -28,7 +22,7 @@ const $queryArgs = atom<ListImagesArgs | null>(null);
2822
*
2923
* This hook is a singleton.
3024
*/
31-
export const useGalleryImages = (): UseGalleryImagesReturn => {
25+
export const useGalleryImages = () => {
3226
const galleryView = useAppSelector((s) => s.gallery.galleryView);
3327
const baseQueryArgs = useAppSelector(selectListImagesBaseQueryArgs);
3428
const queryArgs = useStore($queryArgs);

0 commit comments

Comments
 (0)