Enhance chat and market integration with message forwarding
- Make ChatService globally available for other modules, enabling market-related message handling. - Introduce a market message handler in ChatService to process market-related direct messages (DMs). - Update useMarket to register the market message handler with ChatService, streamlining order-related DM processing. - Refactor message handling logic to differentiate between market messages and regular chat messages, improving message management. - Enhance order update logging in nostrmarketService for better debugging and verification of order status.
This commit is contained in:
parent
db9b50240d
commit
4258ea87c4
5 changed files with 98 additions and 19 deletions
|
|
@ -377,6 +377,16 @@ export class NostrmarketService {
|
|||
paymentStatus: updatedOrder.paymentStatus,
|
||||
hasQRCode: !!updatedOrder.qrCodeDataUrl
|
||||
})
|
||||
|
||||
// Debug: Check if the order was actually updated in the store
|
||||
const verifyOrder = Object.values(marketStore.orders).find(o =>
|
||||
o.id === paymentRequest.id || o.originalOrderId === paymentRequest.id
|
||||
)
|
||||
console.log('Verified order in store after update:', {
|
||||
found: !!verifyOrder,
|
||||
hasPaymentRequest: !!verifyOrder?.paymentRequest,
|
||||
paymentStatus: verifyOrder?.paymentStatus
|
||||
})
|
||||
} else {
|
||||
console.warn('Payment request received for unknown order:', paymentRequest.id)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue