mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): reset node execution states on cancel
This commit is contained in:
parent
044d4c107a
commit
f2334ec302
@ -1,5 +1,5 @@
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
||||
import { cloneDeep, forEach, isEqual, uniqBy } from 'lodash-es';
|
||||
import { cloneDeep, forEach, isEqual, map, uniqBy } from 'lodash-es';
|
||||
import {
|
||||
addEdge,
|
||||
applyEdgeChanges,
|
||||
@ -18,7 +18,7 @@ import {
|
||||
Viewport,
|
||||
} from 'reactflow';
|
||||
import { receivedOpenAPISchema } from 'services/api/thunks/schema';
|
||||
import { sessionInvoked } from 'services/api/thunks/session';
|
||||
import { sessionCanceled, sessionInvoked } from 'services/api/thunks/session';
|
||||
import { ImageField } from 'services/api/types';
|
||||
import {
|
||||
appSocketGeneratorProgress,
|
||||
@ -818,6 +818,13 @@ const nodesSlice = createSlice({
|
||||
nes.outputs = [];
|
||||
});
|
||||
});
|
||||
builder.addCase(sessionCanceled.fulfilled, (state) => {
|
||||
map(state.nodeExecutionStates, (nes) => {
|
||||
if (nes.status === NodeStatus.IN_PROGRESS) {
|
||||
nes.status = NodeStatus.PENDING;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user