Refactor PaymentService and related components for improved state management
- Reset payment state on initialization in PaymentService to prevent stuck states. - Introduce forceResetPaymentState method for debugging purposes. - Update useTicketPurchase and useLightningPayment composables to reflect changes in computed properties for better state handling. - Ensure OrderHistory component resets payment state on mount to enhance user experience.
This commit is contained in:
parent
ef7333e68e
commit
e8b9f04494
4 changed files with 28 additions and 8 deletions
|
|
@ -8,10 +8,10 @@ export function useLightningPayment() {
|
|||
const marketStore = useMarketStore()
|
||||
|
||||
// Computed properties - delegate to PaymentService
|
||||
const userWallets = computed(() => paymentService.userWallets)
|
||||
const hasWalletWithBalance = computed(() => paymentService.hasWalletWithBalance)
|
||||
const isPayingWithWallet = computed(() => paymentService.isProcessingPayment)
|
||||
const paymentError = computed(() => paymentService.paymentError)
|
||||
const userWallets = computed(() => paymentService.userWallets) // getter method
|
||||
const hasWalletWithBalance = computed(() => paymentService.hasWalletWithBalance) // getter method
|
||||
const isPayingWithWallet = computed(() => paymentService.isProcessingPayment.value) // computed ref
|
||||
const paymentError = computed(() => paymentService.paymentError.value) // computed ref
|
||||
|
||||
// Get wallet with sufficient balance - delegate to PaymentService
|
||||
const getWalletWithBalance = (requiredAmountSats?: number) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue