Skip to content

Commit 3edbfa0

Browse files
fix: user order regression
1 parent 5eca70e commit 3edbfa0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

internal/asset/asset.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ func GetAssets(ctx c.Context, assetGroupQuote c.AssetGroupQuote) ([]c.Asset, Hol
3030
holdingsBySymbol := getLots(assetGroupQuote.AssetGroup.ConfigAssetGroup.Holdings)
3131
orderIndex := make(map[string]int)
3232

33-
for i, symbol := range assetGroupQuote.AssetGroup.ConfigAssetGroup.Watchlist {
34-
if _, exists := orderIndex[symbol]; !exists {
35-
orderIndex[strings.ToLower(symbol)] = i
33+
for i, symbol := range assetGroupQuote.AssetGroup.ConfigAssetGroup.Holdings {
34+
if _, exists := orderIndex[symbol.Symbol]; !exists {
35+
orderIndex[strings.ToLower(symbol.Symbol)] = i
3636
}
3737
}
3838

39-
for i, symbol := range assetGroupQuote.AssetGroup.ConfigAssetGroup.Holdings {
40-
if _, exists := orderIndex[symbol.Symbol]; !exists {
41-
orderIndex[strings.ToLower(symbol.Symbol)] = i + len(assetGroupQuote.AssetGroup.ConfigAssetGroup.Watchlist) - 1
39+
for i, symbol := range assetGroupQuote.AssetGroup.ConfigAssetGroup.Watchlist {
40+
if _, exists := orderIndex[symbol]; !exists {
41+
orderIndex[strings.ToLower(symbol)] = i + len(assetGroupQuote.AssetGroup.ConfigAssetGroup.Holdings)
4242
}
4343
}
4444

0 commit comments

Comments
 (0)