fix: initialize selected environment correctly to prevent flicker in EnvironmentSettings component; remove transition from StyledWrapper in RequestTabs and WorkspaceTabs (#6536)

This commit is contained in:
Abhishek S Lal
2025-12-29 16:59:22 +05:30
committed by GitHub
parent 646f63dbeb
commit 1b57b6bee6
3 changed files with 6 additions and 5 deletions

View File

@@ -24,12 +24,15 @@ const DefaultTab = ({ setTab }) => (
const EnvironmentSettings = ({ collection }) => {
const [isModified, setIsModified] = useState(false);
const [selectedEnvironment, setSelectedEnvironment] = useState(null);
const environments = collection?.environments || [];
const [selectedEnvironment, setSelectedEnvironment] = useState(() => {
if (!environments.length) return null;
return environments.find((env) => env.uid === collection?.activeEnvironmentUid) || environments[0];
});
const [tab, setTab] = useState('default');
const [showExportModal, setShowExportModal] = useState(false);
const environments = collection?.environments || [];
if (!environments || !environments.length) {
return (
<StyledWrapper>

View File

@@ -59,7 +59,6 @@ const Wrapper = styled.div`
border: 1px solid transparent;
padding: 6px 0;
flex-shrink: 0;
transition: background-color 0.15s ease;
margin-bottom: 3px;
.tab-container {

View File

@@ -59,7 +59,6 @@ const Wrapper = styled.div`
border: 1px solid transparent;
padding: 6px 0;
flex-shrink: 0;
transition: background-color 0.15s ease;
margin-bottom: 3px;
.tab-container {