Merge pull request #1172 from Zomzog/1117_sort_env

fix(#1117): Sort env alphabetically
This commit is contained in:
Anoop M D 2023-12-09 19:13:04 +05:30 committed by GitHub
commit 8ddec6bf0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1224,6 +1224,7 @@ export const collectionsSlice = createSlice({
existingEnv.variables = environment.variables; existingEnv.variables = environment.variables;
} else { } else {
collection.environments.push(environment); collection.environments.push(environment);
collection.environments.sort((a, b) => a.name.localeCompare(b.name));
const lastAction = collection.lastAction; const lastAction = collection.lastAction;
if (lastAction && lastAction.type === 'ADD_ENVIRONMENT') { if (lastAction && lastAction.type === 'ADD_ENVIRONMENT') {