fix: active enviroment after rename when there is single enviroment (#2640)

This commit is contained in:
Rinku Chaudhari 2024-07-16 16:08:26 +05:45 committed by GitHub
parent 34a961967e
commit 81497d8397
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,7 +43,7 @@ const EnvironmentList = ({ selectedEnvironment, setSelectedEnvironment, collecti
}
}
if (prevEnvUids && prevEnvUids.length && envUids.length < prevEnvUids.length) {
if (prevEnvUids && prevEnvUids.length && envUids.length <= prevEnvUids.length) {
setSelectedEnvironment(environments && environments.length ? environments[0] : null);
}
}, [envUids, environments, prevEnvUids]);