Skip to content

Commit

Permalink
fix(ui): do not reset node outputs on queue item completed
Browse files Browse the repository at this point in the history
  • Loading branch information
psychedelicious authored and Millu committed Sep 21, 2023
1 parent 0d94bed commit 3699637
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import { cloneDeep, forEach, isEqual, map, uniqBy } from 'lodash-es';
import { cloneDeep, forEach, isEqual, uniqBy } from 'lodash-es';
import {
addEdge,
applyEdgeChanges,
Expand All @@ -19,7 +19,6 @@ import {
XYPosition,
} from 'reactflow';
import { receivedOpenAPISchema } from 'services/api/thunks/schema';
import { sessionCanceled, sessionInvoked } from 'services/api/thunks/session';
import { ImageField } from 'services/api/types';
import {
appSocketGeneratorProgress,
Expand Down Expand Up @@ -869,28 +868,10 @@ const nodesSlice = createSlice({
node.progressImage = progress_image ?? null;
}
});
builder.addCase(sessionInvoked.fulfilled, (state) => {
forEach(state.nodeExecutionStates, (nes) => {
nes.status = NodeStatus.PENDING;
nes.error = null;
nes.progress = null;
nes.progressImage = null;
nes.outputs = [];
});
});
builder.addCase(sessionCanceled.fulfilled, (state) => {
map(state.nodeExecutionStates, (nes) => {
if (nes.status === NodeStatus.IN_PROGRESS) {
nes.status = NodeStatus.PENDING;
}
});
});
builder.addCase(appSocketQueueItemStatusChanged, (state, action) => {
if (
['completed', 'canceled', 'failed'].includes(action.payload.data.status)
) {
if (['in_progress'].includes(action.payload.data.status)) {
forEach(state.nodeExecutionStates, (nes) => {
nes.status = NodeStatus.PENDING;
nes.status = NodeStatus.IN_PROGRESS;
nes.error = null;
nes.progress = null;
nes.progressImage = null;
Expand Down

0 comments on commit 3699637

Please sign in to comment.