refactor: better name for duplicated environment
This commit is contained in:
@@ -87,12 +87,14 @@ const dispatchers = defineDispatchers({
|
|||||||
environments,
|
environments,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const index =
|
||||||
|
environments.filter((env) => env.name === newEnvironment.name).length + 1
|
||||||
return {
|
return {
|
||||||
environments: [
|
environments: [
|
||||||
...environments,
|
...environments,
|
||||||
{
|
{
|
||||||
...cloneDeep(newEnvironment),
|
...cloneDeep(newEnvironment),
|
||||||
name: `Duplicate of ${newEnvironment.name}`,
|
name: `${newEnvironment.name} ${index}`,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user