File tree 1 file changed +8
-8
lines changed
web/app/components/workflow/nodes/if-else
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -78,24 +78,24 @@ const useConfig = (id: string, payload: IfElseNodeType) => {
78
78
} )
79
79
80
80
const handleAddCase = useCallback ( ( ) => {
81
- const newInputs = produce ( inputs , ( ) => {
82
- if ( inputs . cases ) {
81
+ const newInputs = produce ( inputs , ( draft ) => {
82
+ if ( draft . cases ) {
83
83
const case_id = uuid4 ( )
84
- inputs . cases . push ( {
84
+ draft . cases . push ( {
85
85
case_id,
86
86
logical_operator : LogicalOperator . and ,
87
87
conditions : [ ] ,
88
88
} )
89
- if ( inputs . _targetBranches ) {
90
- const elseCaseIndex = inputs . _targetBranches . findIndex ( branch => branch . id === 'false' )
89
+ if ( draft . _targetBranches ) {
90
+ const elseCaseIndex = draft . _targetBranches . findIndex ( branch => branch . id === 'false' )
91
91
if ( elseCaseIndex > - 1 ) {
92
- inputs . _targetBranches = branchNameCorrect ( [
93
- ...inputs . _targetBranches . slice ( 0 , elseCaseIndex ) ,
92
+ draft . _targetBranches = branchNameCorrect ( [
93
+ ...draft . _targetBranches . slice ( 0 , elseCaseIndex ) ,
94
94
{
95
95
id : case_id ,
96
96
name : '' ,
97
97
} ,
98
- ...inputs . _targetBranches . slice ( elseCaseIndex ) ,
98
+ ...draft . _targetBranches . slice ( elseCaseIndex ) ,
99
99
] )
100
100
}
101
101
}
You can’t perform that action at this time.
0 commit comments