mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-10 03:13:33 +02:00
Compare commits
6 Commits
main
...
worktree-f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2a3f7a669 | ||
|
|
356b8ea0d6 | ||
|
|
f283b02cfe | ||
|
|
df089e6f00 | ||
|
|
0979398215 | ||
|
|
85260ab49a |
@@ -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