Update WalletService and WalletPage to handle timestamps more robustly
- Modified WalletService to set a default timestamp when payment time is not provided, ensuring consistent date handling. - Enhanced WalletPage to validate timestamps before formatting, preventing potential errors and improving user experience by displaying a placeholder for invalid timestamps. These changes improve the reliability of transaction data presentation in the wallet module.
This commit is contained in:
parent
e5054fdb9d
commit
876eb4f20b
2 changed files with 14 additions and 5 deletions
|
|
@ -271,7 +271,7 @@ export default class WalletService extends BaseService {
|
|||
id: payment.payment_hash,
|
||||
amount: Math.abs(payment.amount),
|
||||
description: payment.memo || payment.description || 'No description',
|
||||
timestamp: new Date(payment.time * 1000),
|
||||
timestamp: payment.time ? new Date(payment.time * 1000) : new Date(),
|
||||
type: payment.amount > 0 ? 'received' : 'sent',
|
||||
status: payment.pending ? 'pending' : 'confirmed',
|
||||
fee: payment.fee
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue