Skip to content

Commit 61114ce

Browse files
fix(ui): update board totals when generation completes
1 parent f3554b4 commit 61114ce

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

invokeai/frontend/web/src/services/events/onInvocationComplete.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
selectAutoSwitch,
66
selectGalleryView,
77
selectGetImageNamesQueryArgs,
8+
selectListBoardsQueryArgs,
89
selectSelectedBoardId,
910
} from 'features/gallery/store/gallerySelectors';
1011
import { boardIdSelected, galleryViewChanged, imageSelected } from 'features/gallery/store/gallerySlice';
@@ -76,6 +77,14 @@ export const buildOnInvocationComplete = (
7677
}
7778
dispatch(boardsApi.util.upsertQueryEntries(entries));
7879

80+
dispatch(
81+
boardsApi.util.updateQueryData('listAllBoards', selectListBoardsQueryArgs(getState()), (draft) => {
82+
for (const board of draft) {
83+
board.image_count = board.image_count + (boardTotalAdditions[board.board_id] ?? 0);
84+
}
85+
})
86+
);
87+
7988
/**
8089
* Optimistic update and cache invalidation for image names queries that match this image's board and categories.
8190
* - Optimistic update for the cache that does not have a search term (we cannot derive the correct insertion

0 commit comments

Comments
 (0)