From 456a0a59e0300654e66b62d662178225568e1b16 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 21 Sep 2023 23:05:14 +1000 Subject: [PATCH] fix(ui): do not reset node outputs on queue item completed --- .../src/features/nodes/store/nodesSlice.ts | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts index e59105348f..71073068ae 100644 --- a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts +++ b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts @@ -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, @@ -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, @@ -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;