Skip to content

Commit

Permalink
πŸ› Fix unable to generate custom purchase link
Browse files Browse the repository at this point in the history
  • Loading branch information
nwingt authored and williamchong committed Dec 24, 2024
1 parent c8a8c8c commit e54183a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions pages/purchase-link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -468,16 +468,20 @@ const productIdInput = computed(() => {
})
const productIds = computed(() => {
return productIdInputs.value.map((input) => {
return productIdInputs.value.map((productIdInput: string) => {
let input: string | undefined = productIdInput.trim()
if (input.startsWith('http')) {
const url = new URL(input)
const id = url.pathname.split('/').pop()
if (id?.startsWith('col_') || id?.startsWith('likenft')) {
return id
}
input = url.pathname.split('/').pop()
}
return input
})
if (input?.startsWith('col_') || input?.startsWith('likenft')) {
return input
}
return ''
}).filter(Boolean)
})
const productId = computed(() => {
return productIds.value[0] || ''
Expand Down

0 comments on commit e54183a

Please sign in to comment.