Revert "fix: active enviroment after rename when there is single enviroment (…" (#2660)

This reverts commit 81497d8397.
This commit is contained in:
Sanjai Kumar 2024-07-19 16:51:12 +05:30 committed by GitHub
parent 9892f7cd40
commit 2804ce1eb3
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); setSelectedEnvironment(environments && environments.length ? environments[0] : null);
} }
}, [envUids, environments, prevEnvUids]); }, [envUids, environments, prevEnvUids]);