fix(treasurechest): fix sorting for children #97

Merged
tim merged 1 commits from fix-sort into prod 2025-05-17 15:48:09 +00:00

View File

@@ -305,7 +305,13 @@ func sortTree(nodes []*types.TreasureChest) []*types.TreasureChest {
for _, root := range roots {
result = append(result, root)
result = append(result, children[root.Id]...)
childList := children[root.Id]
slices.SortFunc(childList, func(a, b *types.TreasureChest) int {
return compareStrings(a.Name, b.Name)
})
result = append(result, childList...)
}
return result