Refactor imports and enhance type handling across components

- Update import paths for useTicketPurchase in PurchaseTicketDialog.vue to reflect new module structure.
- Adjust type handling in Navbar.vue and various market components to use 'any' for improved compatibility with existing data structures.
- Enhance useLightningPayment composable to include shipping zone details, ensuring better order management.
- Remove unused pages (events.vue, MyTickets.vue, OrderHistory.vue) to streamline the codebase and improve maintainability.
This commit is contained in:
padreug 2025-09-05 05:42:44 +02:00
parent 18f48581cd
commit 861c032300
12 changed files with 37 additions and 1217 deletions

View file

@ -3,13 +3,11 @@ import { useAuth } from '@/composables/useAuth'
import { useMarketStore } from '../stores/market'
// Simplified bolt11 parser to extract payment hash
function parseBolt11(bolt11: string): { paymentHash?: string } {
function parseBolt11(_bolt11: string): { paymentHash?: string } {
try {
// Remove lightning: prefix if present
const cleanBolt11 = bolt11.replace(/^lightning:/, '')
// Very basic bolt11 parsing - in a real app you'd use a proper library
// For now, we'll return empty since this requires complex bech32 decoding
// Note: Remove lightning: prefix if present: bolt11.replace(/^lightning:/, '')
return {}
} catch (error) {
console.error('Failed to parse bolt11:', error)
@ -94,7 +92,11 @@ export function usePaymentStatusChecker() {
status: 'paid' as const,
paymentStatus: 'paid' as const,
paidAt: Math.floor(Date.now() / 1000),
items: [...order.items] // Convert readonly to mutable
items: [...order.items], // Convert readonly to mutable
shippingZone: order.shippingZone ? {
...order.shippingZone,
countries: order.shippingZone.countries ? [...order.shippingZone.countries] : undefined
} : order.shippingZone
}
marketStore.updateOrder(orderId, updatedOrder)