fix: env var overriding by ogzhanolguncu · Pull Request #5355 · unkeyed/unkey

Verify each finding against the current code and only fix it if needed.

In
`@web/apps/dashboard/app/`(app)/[workspaceSlug]/projects/[projectId]/(overview)/settings/components/advanced-settings/env-vars/use-drop-zone.ts
around lines 68 - 72, Extract the repeated import sequence into a helper
function (e.g., importEnvVars) that accepts parsed rows and performs the same
steps: use getValues("envVars") to filter out empty keys, map parsed rows to
include environmentId: defaultEnvironmentId, call reset({ envVars: [...existing,
...newRows] }, { keepDefaultValues: true }), call toast.success(`Imported
${parsed.length} variable(s)`), and call trigger(); then replace the three
duplicated blocks (the paste, text paste, and drop handlers) with a single call
to importEnvVars(parsed) so getValues, reset, toast.success, trigger and
defaultEnvironmentId are only referenced inside that helper.