fix: regressions in environment details modal
This commit is contained in:
@@ -245,25 +245,27 @@ const saveEnvironment = () => {
|
||||
return
|
||||
}
|
||||
|
||||
if (props.action === "new") {
|
||||
createEnvironment(name.value)
|
||||
setCurrentEnvironment(envList.value.length - 1)
|
||||
}
|
||||
|
||||
const environmentUpdated: Environment = {
|
||||
name: name.value,
|
||||
variables: vars.value,
|
||||
}
|
||||
|
||||
if (props.editingEnvironmentIndex === "Global")
|
||||
setGlobalEnvVariables(environmentUpdated.variables)
|
||||
else if (props.action === "new") {
|
||||
if (props.action === "new") {
|
||||
// Creating a new environment
|
||||
createEnvironment(name.value)
|
||||
updateEnvironment(envList.value.length - 1, environmentUpdated)
|
||||
setCurrentEnvironment(envList.value.length - 1)
|
||||
toast.success(`${t("environment.created")}`)
|
||||
} else {
|
||||
updateEnvironment(props.editingEnvironmentIndex!, environmentUpdated)
|
||||
} else if (props.editingEnvironmentIndex === "Global") {
|
||||
// Editing the Global environment
|
||||
setGlobalEnvVariables(environmentUpdated.variables)
|
||||
toast.success(`${t("environment.updated")}`)
|
||||
} else if (props.editingEnvironmentIndex) {
|
||||
// Editing an environment
|
||||
updateEnvironment(props.editingEnvironmentIndex, environmentUpdated)
|
||||
toast.success(`${t("environment.updated")}`)
|
||||
}
|
||||
|
||||
hideModal()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user