mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): reset canvas batchIds on clear/batch cancel (#4890)
## What type of PR is this? (check all applicable) - [ ] Refactor - [ ] Feature - [x] Bug Fix - [ ] Optimization - [ ] Documentation Update - [ ] Community Node Submission ## Description This was in the original fix in #4829 but I must have removed it accidentally. ## Related Tickets & Documents <!-- For pull requests that relate or close an issue, please include them below. For example having the text: "closes #1234" would connect the current pull request to issue 1234. And when we merge the pull request, Github will automatically close the issue. --> - Related Issue # - Closes #4889 ## QA Instructions, Screenshots, Recordings - Start from a fresh canvas session (may need to let a generation finish or reset web UI if yours is locked) - Invoke/add to queue - Immediately cancel current, clear queue, or clear batch (can do this from the queue tab) - Canvas should return to normal state <!-- Please provide steps on how to test changes, any hardware or software specifications as well as any other pertinent information. -->
This commit is contained in:
commit
10755718b8
@ -30,6 +30,7 @@ import {
|
||||
isCanvasMaskLine,
|
||||
} from './canvasTypes';
|
||||
import { appSocketQueueItemStatusChanged } from 'services/events/actions';
|
||||
import { queueApi } from 'services/api/endpoints/queue';
|
||||
|
||||
export const initialLayerState: CanvasLayerState = {
|
||||
objects: [],
|
||||
@ -812,6 +813,20 @@ export const canvasSlice = createSlice({
|
||||
);
|
||||
}
|
||||
});
|
||||
builder.addMatcher(
|
||||
queueApi.endpoints.clearQueue.matchFulfilled,
|
||||
(state) => {
|
||||
state.batchIds = [];
|
||||
}
|
||||
);
|
||||
builder.addMatcher(
|
||||
queueApi.endpoints.cancelByBatchIds.matchFulfilled,
|
||||
(state, action) => {
|
||||
state.batchIds = state.batchIds.filter(
|
||||
(id) => !action.meta.arg.originalArgs.batch_ids.includes(id)
|
||||
);
|
||||
}
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user