mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-14 01:06:06 +00:00
refactor(ui): avoid model group map spreads (#106732)
This commit is contained in:
committed by
GitHub
parent
78bf10f6d1
commit
e2cc1ea0f7
@@ -48,12 +48,11 @@ function modelGroups(models: ModelPickerEntry[]): ModelOptionGroup[] {
|
||||
group.models.push({ ref, label: model.name || ref });
|
||||
groups.set(groupKey, group);
|
||||
}
|
||||
return [...groups.values()]
|
||||
.map((group) => ({
|
||||
...group,
|
||||
models: group.models.toSorted((a, b) => a.label.localeCompare(b.label)),
|
||||
}))
|
||||
.toSorted((a, b) => a.label.localeCompare(b.label));
|
||||
const sortedGroups = [...groups.values()];
|
||||
for (const group of sortedGroups) {
|
||||
group.models = group.models.toSorted((a, b) => a.label.localeCompare(b.label));
|
||||
}
|
||||
return sortedGroups.toSorted((a, b) => a.label.localeCompare(b.label));
|
||||
}
|
||||
|
||||
function renderModelOptions(models: ModelPickerEntry[], selected = "") {
|
||||
|
||||
Reference in New Issue
Block a user