11import { createSlice , PayloadAction } from '@reduxjs/toolkit' ;
2- import { cloneDeep , forEach , isEqual , map , uniqBy } from 'lodash-es' ;
2+ import { cloneDeep , forEach , isEqual , uniqBy } from 'lodash-es' ;
33import {
44 addEdge ,
55 applyEdgeChanges ,
@@ -19,7 +19,6 @@ import {
1919 XYPosition ,
2020} from 'reactflow' ;
2121import { receivedOpenAPISchema } from 'services/api/thunks/schema' ;
22- import { sessionCanceled , sessionInvoked } from 'services/api/thunks/session' ;
2322import { ImageField } from 'services/api/types' ;
2423import {
2524 appSocketGeneratorProgress ,
@@ -869,28 +868,10 @@ const nodesSlice = createSlice({
869868 node . progressImage = progress_image ?? null ;
870869 }
871870 } ) ;
872- builder . addCase ( sessionInvoked . fulfilled , ( state ) => {
873- forEach ( state . nodeExecutionStates , ( nes ) => {
874- nes . status = NodeStatus . PENDING ;
875- nes . error = null ;
876- nes . progress = null ;
877- nes . progressImage = null ;
878- nes . outputs = [ ] ;
879- } ) ;
880- } ) ;
881- builder . addCase ( sessionCanceled . fulfilled , ( state ) => {
882- map ( state . nodeExecutionStates , ( nes ) => {
883- if ( nes . status === NodeStatus . IN_PROGRESS ) {
884- nes . status = NodeStatus . PENDING ;
885- }
886- } ) ;
887- } ) ;
888871 builder . addCase ( appSocketQueueItemStatusChanged , ( state , action ) => {
889- if (
890- [ 'completed' , 'canceled' , 'failed' ] . includes ( action . payload . data . status )
891- ) {
872+ if ( [ 'in_progress' ] . includes ( action . payload . data . status ) ) {
892873 forEach ( state . nodeExecutionStates , ( nes ) => {
893- nes . status = NodeStatus . PENDING ;
874+ nes . status = NodeStatus . IN_PROGRESS ;
894875 nes . error = null ;
895876 nes . progress = null ;
896877 nes . progressImage = null ;
0 commit comments