mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
fix(ui): update board totals when generation completes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user