File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -187,9 +187,17 @@ const Sidebar = ({
187
187
value = { key }
188
188
onChange = { ( e ) => {
189
189
const newKey = e . target . value ;
190
- const newEnv = { ...env } ;
191
- delete newEnv [ key ] ;
192
- newEnv [ newKey ] = value ;
190
+ const newEnv = Object . entries ( env ) . reduce (
191
+ ( acc , [ k , v ] ) => {
192
+ if ( k === key ) {
193
+ acc [ newKey ] = value ;
194
+ } else {
195
+ acc [ k ] = v ;
196
+ }
197
+ return acc ;
198
+ } ,
199
+ { } as Record < string , string > ,
200
+ ) ;
193
201
setEnv ( newEnv ) ;
194
202
setShownEnvVars ( ( prev ) => {
195
203
const next = new Set ( prev ) ;
Original file line number Diff line number Diff line change @@ -234,6 +234,7 @@ const ToolsTab = ({
234
234
id = { key }
235
235
name = { key }
236
236
placeholder = { prop . description }
237
+ value = { ( params [ key ] as string ) ?? "" }
237
238
onChange = { ( e ) =>
238
239
setParams ( {
239
240
...params ,
You can’t perform that action at this time.
0 commit comments