fix(events): let guests default to the card rail in the purchase dialog #146
1 changed files with 4 additions and 2 deletions
fix(events): let guests default to the card rail in the purchase dialog
`selectedMethodId` started as 'lightning', so the "keep the current selection" guard in the default-rail watcher always found a match and the guest preference for fiat never applied — verified on demo, where an anonymous buyer saw "Proceed" (Lightning) preselected with Card on offer. Start empty and reset to empty on close so each open re-evaluates: guests land on Card when it exists, everyone else on the first enabled rail, exactly as the comment already promised. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYwoAkZZmXMMmaBp4WGUBo
commit
1e43e8ed0a
|
|
@ -161,7 +161,9 @@ watch(
|
||||||
const { providers, providerMeta } = useFiatProviders()
|
const { providers, providerMeta } = useFiatProviders()
|
||||||
const { convert } = usePriceConversion()
|
const { convert } = usePriceConversion()
|
||||||
|
|
||||||
const selectedMethodId = ref<string>('lightning')
|
// Empty until the dialog opens: the watcher below picks the default per
|
||||||
|
// rail availability + auth state, so a guest lands on Card, not Lightning.
|
||||||
|
const selectedMethodId = ref<string>('')
|
||||||
const isFiatPending = ref(false)
|
const isFiatPending = ref(false)
|
||||||
const fiatError = ref<string | null>(null)
|
const fiatError = ref<string | null>(null)
|
||||||
|
|
||||||
|
|
@ -336,7 +338,7 @@ async function handlePurchase(contact: { name?: string; email: string }) {
|
||||||
function handleClose() {
|
function handleClose() {
|
||||||
emit('update:isOpen', false)
|
emit('update:isOpen', false)
|
||||||
resetPaymentState()
|
resetPaymentState()
|
||||||
selectedMethodId.value = 'lightning'
|
selectedMethodId.value = ''
|
||||||
fiatError.value = null
|
fiatError.value = null
|
||||||
isFiatPending.value = false
|
isFiatPending.value = false
|
||||||
quantity.value = 1
|
quantity.value = 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue