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:
parent
18f48581cd
commit
861c032300
12 changed files with 37 additions and 1217 deletions
|
|
@ -67,7 +67,11 @@ export function useLightningPayment() {
|
|||
paidAt: Math.floor(Date.now() / 1000),
|
||||
paymentHash: paymentResult.payment_hash,
|
||||
feeMsat: paymentResult.fee_msat,
|
||||
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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -395,7 +395,6 @@ export function useMarket() {
|
|||
console.log('🔔 Received order-related DM:', event.id, 'from:', event.pubkey.slice(0, 8))
|
||||
|
||||
// TODO: Confirm if this should use nostrStore.account?.pubkey or authService.user.value?.pubkey
|
||||
const userPubkey = nostrStore.account?.pubkey || authService.user.value?.pubkey
|
||||
const userPrivkey = nostrStore.account?.privkey || authService.user.value?.prvkey
|
||||
|
||||
if (!userPrivkey) {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue