From 97a16c455c16d6c27f8e455ae64accea547b6a8d Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 15 Aug 2025 16:23:10 +1000 Subject: [PATCH] fix(ui): update board totals when generation completes --- .../web/src/services/events/onInvocationComplete.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/invokeai/frontend/web/src/services/events/onInvocationComplete.tsx b/invokeai/frontend/web/src/services/events/onInvocationComplete.tsx index 6835ab00f7..d7972ba0a4 100644 --- a/invokeai/frontend/web/src/services/events/onInvocationComplete.tsx +++ b/invokeai/frontend/web/src/services/events/onInvocationComplete.tsx @@ -5,6 +5,7 @@ import { selectAutoSwitch, selectGalleryView, selectGetImageNamesQueryArgs, + selectListBoardsQueryArgs, selectSelectedBoardId, } from 'features/gallery/store/gallerySelectors'; import { boardIdSelected, galleryViewChanged, imageSelected } from 'features/gallery/store/gallerySlice'; @@ -76,6 +77,14 @@ export const buildOnInvocationComplete = ( } dispatch(boardsApi.util.upsertQueryEntries(entries)); + dispatch( + boardsApi.util.updateQueryData('listAllBoards', selectListBoardsQueryArgs(getState()), (draft) => { + for (const board of draft) { + board.image_count = board.image_count + (boardTotalAdditions[board.board_id] ?? 0); + } + }) + ); + /** * Optimistic update and cache invalidation for image names queries that match this image's board and categories. * - Optimistic update for the cache that does not have a search term (we cannot derive the correct insertion