mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): do not reset node outputs on queue item completed
This commit is contained in:
parent
4f2bf7e7e8
commit
456a0a59e0
@ -1,5 +1,5 @@
|
|||||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
||||||
import { cloneDeep, forEach, isEqual, map, uniqBy } from 'lodash-es';
|
import { cloneDeep, forEach, isEqual, uniqBy } from 'lodash-es';
|
||||||
import {
|
import {
|
||||||
addEdge,
|
addEdge,
|
||||||
applyEdgeChanges,
|
applyEdgeChanges,
|
||||||
@ -19,7 +19,6 @@ import {
|
|||||||
XYPosition,
|
XYPosition,
|
||||||
} from 'reactflow';
|
} from 'reactflow';
|
||||||
import { receivedOpenAPISchema } from 'services/api/thunks/schema';
|
import { receivedOpenAPISchema } from 'services/api/thunks/schema';
|
||||||
import { sessionCanceled, sessionInvoked } from 'services/api/thunks/session';
|
|
||||||
import { ImageField } from 'services/api/types';
|
import { ImageField } from 'services/api/types';
|
||||||
import {
|
import {
|
||||||
appSocketGeneratorProgress,
|
appSocketGeneratorProgress,
|
||||||
@ -869,28 +868,10 @@ const nodesSlice = createSlice({
|
|||||||
node.progressImage = progress_image ?? null;
|
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) => {
|
builder.addCase(appSocketQueueItemStatusChanged, (state, action) => {
|
||||||
if (
|
if (['in_progress'].includes(action.payload.data.status)) {
|
||||||
['completed', 'canceled', 'failed'].includes(action.payload.data.status)
|
|
||||||
) {
|
|
||||||
forEach(state.nodeExecutionStates, (nes) => {
|
forEach(state.nodeExecutionStates, (nes) => {
|
||||||
nes.status = NodeStatus.PENDING;
|
nes.status = NodeStatus.IN_PROGRESS;
|
||||||
nes.error = null;
|
nes.error = null;
|
||||||
nes.progress = null;
|
nes.progress = null;
|
||||||
nes.progressImage = null;
|
nes.progressImage = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user