mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
fix: resolve the issue same id component
This commit is contained in:
@@ -21,8 +21,14 @@ function groupModelsByProvider(models) {
|
||||
groups[key] = {
|
||||
provider: model.provider,
|
||||
models: [],
|
||||
modelIds: new Set(),
|
||||
};
|
||||
}
|
||||
|
||||
// The API normally supplies unique models. Ignore a duplicate defensively
|
||||
// so a malformed response cannot produce duplicate React keys.
|
||||
if (groups[key].modelIds.has(model.fullModel)) return groups;
|
||||
groups[key].modelIds.add(model.fullModel);
|
||||
groups[key].models.push(model);
|
||||
return groups;
|
||||
}, {});
|
||||
|
||||
Reference in New Issue
Block a user