mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-05-16 12:47:09 +02:00
Fix duplicate request snapshotting URL as name (#429)
This commit is contained in:
@@ -144,9 +144,10 @@ export function duplicateModel<M extends AnyModel["model"], T extends ExtractMod
|
|||||||
throw new Error("Failed to duplicate null model");
|
throw new Error("Failed to duplicate null model");
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the model has a name, try to duplicate it with a name that doesn't conflict
|
// If the model has an explicit (non-empty) name, try to duplicate it with a name that doesn't conflict.
|
||||||
let name = "name" in model ? resolvedModelName(model) : undefined;
|
// When the name is empty, keep it empty so the display falls back to the URL.
|
||||||
if (name != null) {
|
let name = "name" in model ? model.name : undefined;
|
||||||
|
if (name) {
|
||||||
const existingModels = listModels(model.model);
|
const existingModels = listModels(model.model);
|
||||||
for (let i = 0; i < 100; i++) {
|
for (let i = 0; i < 100; i++) {
|
||||||
const hasConflict = existingModels.some((m) => {
|
const hasConflict = existingModels.some((m) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user