Radish alpha
r
Radicle desktop app
Radicle
Git (anonymous pull)
Log in to clone via SSH
Pick seed source by artifact kind, not by fallthrough
Daniel Norman committed 7 days ago
commit d083f93acdbeda4bbd894f5ea85a08271ff374cf
parent 1bce824fa02c1fc5f4e6e003ec68593931d9cb7e
1 file changed +9 -7
modified src/views/repo/Release.svelte
@@ -91,15 +91,17 @@

  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", {