mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): remove unused queries and fix invocation complete listener
This commit is contained in:
@ -13,7 +13,6 @@ import {
|
|||||||
import { $nodeExecutionStates, upsertExecutionState } from 'features/nodes/hooks/useExecutionState';
|
import { $nodeExecutionStates, upsertExecutionState } from 'features/nodes/hooks/useExecutionState';
|
||||||
import { zNodeStatus } from 'features/nodes/types/invocation';
|
import { zNodeStatus } from 'features/nodes/types/invocation';
|
||||||
import { CANVAS_OUTPUT } from 'features/nodes/util/graph/constants';
|
import { CANVAS_OUTPUT } from 'features/nodes/util/graph/constants';
|
||||||
import { boardsApi } from 'services/api/endpoints/boards';
|
|
||||||
import { imagesApi } from 'services/api/endpoints/images';
|
import { imagesApi } from 'services/api/endpoints/images';
|
||||||
import { getCategories, getListImagesUrl } from 'services/api/util';
|
import { getCategories, getListImagesUrl } from 'services/api/util';
|
||||||
import { socketInvocationComplete } from 'services/events/actions';
|
import { socketInvocationComplete } from 'services/events/actions';
|
||||||
@ -52,14 +51,6 @@ export const addInvocationCompleteEventListener = (startAppListening: AppStartLi
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!imageDTO.is_intermediate) {
|
if (!imageDTO.is_intermediate) {
|
||||||
// update the total images for the board
|
|
||||||
dispatch(
|
|
||||||
boardsApi.util.updateQueryData('getBoardImagesTotal', imageDTO.board_id ?? 'none', (draft) => {
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
draft.total += 1;
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
imagesApi.util.invalidateTags([
|
imagesApi.util.invalidateTags([
|
||||||
{ type: 'Board', id: imageDTO.board_id ?? 'none' },
|
{ type: 'Board', id: imageDTO.board_id ?? 'none' },
|
||||||
|
@ -1,13 +1,4 @@
|
|||||||
import { ASSETS_CATEGORIES, IMAGE_CATEGORIES } from 'features/gallery/store/types';
|
import type { BoardDTO, CreateBoardArg, ListBoardsArgs, S, UpdateBoardArg } from 'services/api/types';
|
||||||
import type {
|
|
||||||
BoardDTO,
|
|
||||||
CreateBoardArg,
|
|
||||||
ListBoardsArgs,
|
|
||||||
OffsetPaginatedResults_ImageDTO_,
|
|
||||||
S,
|
|
||||||
UpdateBoardArg,
|
|
||||||
} from 'services/api/types';
|
|
||||||
import { getListImagesUrl } from 'services/api/util';
|
|
||||||
|
|
||||||
import type { ApiTagDescription } from '..';
|
import type { ApiTagDescription } from '..';
|
||||||
import { api, buildV1Url, LIST_TAG } from '..';
|
import { api, buildV1Url, LIST_TAG } from '..';
|
||||||
@ -63,40 +54,6 @@ export const boardsApi = api.injectEndpoints({
|
|||||||
providesTags: ['UncategorizedImageCounts', { type: 'Board', id: LIST_TAG }, { type: 'Board', id: 'none' }],
|
providesTags: ['UncategorizedImageCounts', { type: 'Board', id: LIST_TAG }, { type: 'Board', id: 'none' }],
|
||||||
}),
|
}),
|
||||||
|
|
||||||
getBoardImagesTotal: build.query<{ total: number }, string | undefined>({
|
|
||||||
query: (board_id) => ({
|
|
||||||
url: getListImagesUrl({
|
|
||||||
board_id: board_id ?? 'none',
|
|
||||||
categories: IMAGE_CATEGORIES,
|
|
||||||
is_intermediate: false,
|
|
||||||
limit: 0,
|
|
||||||
offset: 0,
|
|
||||||
}),
|
|
||||||
method: 'GET',
|
|
||||||
}),
|
|
||||||
providesTags: (result, error, arg) => [{ type: 'BoardImagesTotal', id: arg ?? 'none' }, 'FetchOnReconnect'],
|
|
||||||
transformResponse: (response: OffsetPaginatedResults_ImageDTO_) => {
|
|
||||||
return { total: response.total };
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
|
|
||||||
getBoardAssetsTotal: build.query<{ total: number }, string | undefined>({
|
|
||||||
query: (board_id) => ({
|
|
||||||
url: getListImagesUrl({
|
|
||||||
board_id: board_id ?? 'none',
|
|
||||||
categories: ASSETS_CATEGORIES,
|
|
||||||
is_intermediate: false,
|
|
||||||
limit: 0,
|
|
||||||
offset: 0,
|
|
||||||
}),
|
|
||||||
method: 'GET',
|
|
||||||
}),
|
|
||||||
providesTags: (result, error, arg) => [{ type: 'BoardAssetsTotal', id: arg ?? 'none' }, 'FetchOnReconnect'],
|
|
||||||
transformResponse: (response: OffsetPaginatedResults_ImageDTO_) => {
|
|
||||||
return { total: response.total };
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Boards Mutations
|
* Boards Mutations
|
||||||
*/
|
*/
|
||||||
@ -132,8 +89,6 @@ export const boardsApi = api.injectEndpoints({
|
|||||||
|
|
||||||
export const {
|
export const {
|
||||||
useListAllBoardsQuery,
|
useListAllBoardsQuery,
|
||||||
useGetBoardImagesTotalQuery,
|
|
||||||
useGetBoardAssetsTotalQuery,
|
|
||||||
useCreateBoardMutation,
|
useCreateBoardMutation,
|
||||||
useUpdateBoardMutation,
|
useUpdateBoardMutation,
|
||||||
useListAllImageNamesForBoardQuery,
|
useListAllImageNamesForBoardQuery,
|
||||||
|
@ -36,7 +36,6 @@ export type AppDependencyVersions = S['AppDependencyVersions'];
|
|||||||
export type ImageDTO = S['ImageDTO'];
|
export type ImageDTO = S['ImageDTO'];
|
||||||
export type BoardDTO = S['BoardDTO'];
|
export type BoardDTO = S['BoardDTO'];
|
||||||
export type ImageCategory = S['ImageCategory'];
|
export type ImageCategory = S['ImageCategory'];
|
||||||
export type OffsetPaginatedResults_ImageDTO_ = S['OffsetPaginatedResults_ImageDTO_'];
|
|
||||||
|
|
||||||
// Models
|
// Models
|
||||||
export type ModelType = S['ModelType'];
|
export type ModelType = S['ModelType'];
|
||||||
|
Reference in New Issue
Block a user