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