Skip to content

Commit

Permalink
fix(ui): do not invalidate image dto cache when deleting image
Browse files Browse the repository at this point in the history
  • Loading branch information
psychedelicious committed Jul 12, 2024
1 parent 229f46c commit 3477cb4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions invokeai/frontend/web/src/services/api/endpoints/images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export const imagesApi = api.injectEndpoints({
const boardId = imageDTO.board_id ?? 'none';

return [
{ type: 'Image', id: imageDTO.image_name },
{
type: 'ImageList',
id: getListImagesUrl({
Expand Down Expand Up @@ -138,9 +137,6 @@ export const imagesApi = api.injectEndpoints({
id: boardId,
},
];
for (const imageDTO of imageDTOs) {
tags.push({ type: 'Image', id: imageDTO.image_name });
}

return tags;
}
Expand Down Expand Up @@ -508,7 +504,6 @@ export const imagesApi = api.injectEndpoints({
export const {
useGetIntermediatesCountQuery,
useListImagesQuery,
useGetImageDTOQuery,
useGetImageMetadataQuery,
useGetImageWorkflowQuery,
useLazyGetImageWorkflowQuery,
Expand All @@ -526,6 +521,10 @@ export const {
useBulkDownloadImagesMutation,
} = imagesApi;

export const useGetImageDTOQuery = (...args: Parameters<typeof imagesApi.useGetImageDTOQuery>) => {
return imagesApi.useGetImageDTOQuery(...args);
};

/**
* Imperative RTKQ helper to fetch an ImageDTO.
* @param image_name The name of the image to fetch
Expand Down

0 comments on commit 3477cb4

Please sign in to comment.