| |
|
| |
async function seed(artifact: Artifact) {
|
| |
// The frontend doesn't ship the source path for already-COB-recorded
|
| - |
// artifacts, so we ask the user to point at it. (Auto-seed at create
|
| - |
// time stays in NewRelease.svelte where the path is in scope.)
|
| - |
const source = await invoke<string | null>("pick_artifact_directory");
|
| - |
let path = source;
|
| - |
if (!path) {
|
| + |
// artifacts, so we ask the user to point at it. Pick by kind so the
|
| + |
// user sees exactly one picker (folder for collections, file for blobs)
|
| + |
// rather than the previous folder-then-file fallback.
|
| + |
let path: string | null;
|
| + |
if (artifact.kind === "collection") {
|
| + |
path = await invoke<string | null>("pick_artifact_directory");
|
| + |
} else {
|
| |
const files = await invoke<string[]>("pick_artifact_files");
|
| - |
if (files.length === 0) return;
|
| - |
path = files[0];
|
| + |
path = files[0] ?? null;
|
| |
}
|
| + |
if (!path) return;
|
| |
busy[artifact.cid] = true;
|
| |
try {
|
| |
await invoke("seed_artifact", {
|