Fixed small envvar bug where old envvar would get overwritten if new batch were pasted

This commit is contained in:
Waleed Latif
2025-02-03 11:44:52 -08:00
parent 207bd7b4fa
commit 1e79deabef

View File

@@ -182,12 +182,15 @@ export function SettingsModal({ open, onOpenChange }: SettingsModalProps) {
return {
key: key.trim(),
value,
id: Date.now() + Math.random()
}
})
.filter(({ key, value }) => key && value)
if (parsedVars.length > 0) {
setEnvVars(parsedVars)
// Merge existing vars with new ones, removing any empty rows at the end
const existingVars = envVars.filter(v => v.key || v.value)
setEnvVars([...existingVars, ...parsedVars])
}
}