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 @@ -194,9 +194,17 @@ const Sidebar = ({
194194 value = { key }
195195 onChange = { ( e ) => {
196196 const newKey = e . target . value ;
197- const newEnv = { ...env } ;
198- delete newEnv [ key ] ;
199- newEnv [ newKey ] = value ;
197+ const newEnv = Object . entries ( env ) . reduce (
198+ ( acc , [ k , v ] ) => {
199+ if ( k === key ) {
200+ acc [ newKey ] = value ;
201+ } else {
202+ acc [ k ] = v ;
203+ }
204+ return acc ;
205+ } ,
206+ { } as Record < string , string > ,
207+ ) ;
200208 setEnv ( newEnv ) ;
201209 setShownEnvVars ( ( prev ) => {
202210 const next = new Set ( prev ) ;
Original file line number Diff line number Diff line change @@ -233,6 +233,7 @@ const ToolsTab = ({
233233 id = { key }
234234 name = { key }
235235 placeholder = { prop . description }
236+ value = { ( params [ key ] as string ) ?? "" }
236237 onChange = { ( e ) =>
237238 setParams ( {
238239 ...params ,
You can’t perform that action at this time.
0 commit comments