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 = ({
187187 value = { key }
188188 onChange = { ( e ) => {
189189 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+ ) ;
193201 setEnv ( newEnv ) ;
194202 setShownEnvVars ( ( prev ) => {
195203 const next = new Set ( prev ) ;
Original file line number Diff line number Diff line change @@ -234,6 +234,7 @@ const ToolsTab = ({
234234 id = { key }
235235 name = { key }
236236 placeholder = { prop . description }
237+ value = { ( params [ key ] as string ) ?? "" }
237238 onChange = { ( e ) =>
238239 setParams ( {
239240 ...params ,
You can’t perform that action at this time.
0 commit comments