Skip to content

Commit a153035

Browse files
Fix Gumroad product select names (#17)
- ensure fetched Gumroad products populate the select option label - filter out any products missing a slug when building the dropdown
1 parent 1837032 commit a153035

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

gumroad-links.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,11 +781,11 @@ <h3 style="margin: 0; font-size: 1.1rem;">Included parameters</h3>
781781
}
782782

783783
const data = await response.json();
784-
const products = (data.products || []).map(p => ({
785-
title: p.title,
784+
const products = (data.products || []).map((p) => ({
785+
name: p.name || p.title || p.slug || '',
786786
slug: p.slug,
787787
url: p.url,
788-
}));
788+
})).filter((product) => Boolean(product.slug));
789789

790790
if (products.length === 0) {
791791
populateProductSelect([]);

0 commit comments

Comments
 (0)