fix(deploy-to-hub): fall back to slug when import folder is whitespace-only

(folderName || slug).trim() let a whitespace-only folder bypass the slug
fallback and trim to an empty target, producing invalid f//... paths and a
failed import. Trim first, then fall back.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
tristantr
2026-06-08 17:35:05 +02:00
co-authored by Claude Opus 4.8
parent 0e5c4dfe40
commit 271fd2d307
@@ -92,7 +92,7 @@
async function install() {
if (!data || !workspace) return
const folder = (folderName || data.project.slug).trim()
const folder = folderName.trim() || data.project.slug
installing = true
results = []
done = false
@@ -246,7 +246,8 @@
</p>
<FolderPicker bind:folderName disabled={installing || done} size="sm" />
<p class="mt-1 text-xs text-tertiary">
Items import under <span class="font-mono">f/{folderName || data.project.slug}/</span>.
Items import under <span class="font-mono">f/{folderName.trim() || data.project.slug}/</span
>.
</p>
</div>