1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

[PM-2089] Fix Collections not nesting properly in the Org Vault (#5369)

This commit is contained in:
Robyn MacCallum
2023-05-08 13:22:06 -04:00
committed by GitHub
parent 0b9ed77b8e
commit 9bbaae6ef2
2 changed files with 31 additions and 1 deletions

View File

@@ -17,7 +17,9 @@ export function getNestedCollectionTree(
// Collections need to be cloned because ServiceUtils.nestedTraverse actively
// modifies the names of collections.
// These changes risk affecting collections store in StateService.
const clonedCollections = collections.map(cloneCollection);
const clonedCollections = collections
.sort((a, b) => a.name.localeCompare(b.name))
.map(cloneCollection);
const nodes: TreeNode<CollectionView | CollectionAdminView>[] = [];
clonedCollections.forEach((collection) => {