We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 043f604 commit f2f209dCopy full SHA for f2f209d
client/src/components/Sidebar.tsx
@@ -187,9 +187,17 @@ const Sidebar = ({
187
value={key}
188
onChange={(e) => {
189
const newKey = e.target.value;
190
- const newEnv = { ...env };
191
- delete newEnv[key];
192
- newEnv[newKey] = value;
+ const newEnv = Object.entries(env).reduce(
+ (acc, [k, v]) => {
+ if (k === key) {
193
+ acc[newKey] = value;
194
+ } else {
195
+ acc[k] = v;
196
+ }
197
+ return acc;
198
+ },
199
+ {} as Record<string, string>,
200
+ );
201
setEnv(newEnv);
202
setShownEnvVars((prev) => {
203
const next = new Set(prev);
0 commit comments