Skip to content

Commit 6b9f109

Browse files
fix(ui): remove unused queries and fix invocation complete listener
1 parent cb59794 commit 6b9f109

File tree

3 files changed

+1
-56
lines changed

3 files changed

+1
-56
lines changed

invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketInvocationComplete.ts

-9
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
import { $nodeExecutionStates, upsertExecutionState } from 'features/nodes/hooks/useExecutionState';
1414
import { zNodeStatus } from 'features/nodes/types/invocation';
1515
import { CANVAS_OUTPUT } from 'features/nodes/util/graph/constants';
16-
import { boardsApi } from 'services/api/endpoints/boards';
1716
import { imagesApi } from 'services/api/endpoints/images';
1817
import { getCategories, getListImagesUrl } from 'services/api/util';
1918
import { socketInvocationComplete } from 'services/events/actions';
@@ -52,14 +51,6 @@ export const addInvocationCompleteEventListener = (startAppListening: AppStartLi
5251
}
5352

5453
if (!imageDTO.is_intermediate) {
55-
// update the total images for the board
56-
dispatch(
57-
boardsApi.util.updateQueryData('getBoardImagesTotal', imageDTO.board_id ?? 'none', (draft) => {
58-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
59-
draft.total += 1;
60-
})
61-
);
62-
6354
dispatch(
6455
imagesApi.util.invalidateTags([
6556
{ type: 'Board', id: imageDTO.board_id ?? 'none' },

invokeai/frontend/web/src/services/api/endpoints/boards.ts

+1-46
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
import { ASSETS_CATEGORIES, IMAGE_CATEGORIES } from 'features/gallery/store/types';
2-
import type {
3-
BoardDTO,
4-
CreateBoardArg,
5-
ListBoardsArgs,
6-
OffsetPaginatedResults_ImageDTO_,
7-
S,
8-
UpdateBoardArg,
9-
} from 'services/api/types';
10-
import { getListImagesUrl } from 'services/api/util';
1+
import type { BoardDTO, CreateBoardArg, ListBoardsArgs, S, UpdateBoardArg } from 'services/api/types';
112

123
import type { ApiTagDescription } from '..';
134
import { api, buildV1Url, LIST_TAG } from '..';
@@ -63,40 +54,6 @@ export const boardsApi = api.injectEndpoints({
6354
providesTags: ['UncategorizedImageCounts', { type: 'Board', id: LIST_TAG }, { type: 'Board', id: 'none' }],
6455
}),
6556

66-
getBoardImagesTotal: build.query<{ total: number }, string | undefined>({
67-
query: (board_id) => ({
68-
url: getListImagesUrl({
69-
board_id: board_id ?? 'none',
70-
categories: IMAGE_CATEGORIES,
71-
is_intermediate: false,
72-
limit: 0,
73-
offset: 0,
74-
}),
75-
method: 'GET',
76-
}),
77-
providesTags: (result, error, arg) => [{ type: 'BoardImagesTotal', id: arg ?? 'none' }, 'FetchOnReconnect'],
78-
transformResponse: (response: OffsetPaginatedResults_ImageDTO_) => {
79-
return { total: response.total };
80-
},
81-
}),
82-
83-
getBoardAssetsTotal: build.query<{ total: number }, string | undefined>({
84-
query: (board_id) => ({
85-
url: getListImagesUrl({
86-
board_id: board_id ?? 'none',
87-
categories: ASSETS_CATEGORIES,
88-
is_intermediate: false,
89-
limit: 0,
90-
offset: 0,
91-
}),
92-
method: 'GET',
93-
}),
94-
providesTags: (result, error, arg) => [{ type: 'BoardAssetsTotal', id: arg ?? 'none' }, 'FetchOnReconnect'],
95-
transformResponse: (response: OffsetPaginatedResults_ImageDTO_) => {
96-
return { total: response.total };
97-
},
98-
}),
99-
10057
/**
10158
* Boards Mutations
10259
*/
@@ -132,8 +89,6 @@ export const boardsApi = api.injectEndpoints({
13289

13390
export const {
13491
useListAllBoardsQuery,
135-
useGetBoardImagesTotalQuery,
136-
useGetBoardAssetsTotalQuery,
13792
useCreateBoardMutation,
13893
useUpdateBoardMutation,
13994
useListAllImageNamesForBoardQuery,

invokeai/frontend/web/src/services/api/types.ts

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export type AppDependencyVersions = S['AppDependencyVersions'];
3636
export type ImageDTO = S['ImageDTO'];
3737
export type BoardDTO = S['BoardDTO'];
3838
export type ImageCategory = S['ImageCategory'];
39-
export type OffsetPaginatedResults_ImageDTO_ = S['OffsetPaginatedResults_ImageDTO_'];
4039

4140
// Models
4241
export type ModelType = S['ModelType'];

0 commit comments

Comments
 (0)