diff --git a/src/hooks/usePostInvoice.ts b/src/hooks/usePostInvoice.ts index 389f7039..d7993111 100644 --- a/src/hooks/usePostInvoice.ts +++ b/src/hooks/usePostInvoice.ts @@ -171,7 +171,7 @@ export const usePostInvoice = () => { { id: id, status: "open", - time: Math.round(new Date().getTime() / 1000), + createdAt: Math.round(new Date().getTime() / 1000), input: { unit: unit || currency, amount: decimalFiat diff --git a/src/screens/History/History.tsx b/src/screens/History/History.tsx index f3fc1855..1d95931d 100644 --- a/src/screens/History/History.tsx +++ b/src/screens/History/History.tsx @@ -137,7 +137,10 @@ export const History = () => { title: data.defaultDescription, status: data.status || "open", tag: "withdraw", - time: localTransactionsHistory[index].time || 0, + createdAt: + localTransactionsHistory[index].createdAt || + localTransactionsHistory[index].time || + 0, amount: localTransactionsHistory[index]?.amount || data.minWithdrawable } as InvoiceWithLnurlUrl; @@ -206,7 +209,7 @@ export const History = () => { const satsTotal = transactions.reduce((result, transaction) => { if ( - (transaction.time || 0) < startOfToday || + (transaction.createdAt || 0) < startOfToday || transaction.amount <= 0 || transaction.status !== "settled" ) { @@ -339,7 +342,7 @@ export const History = () => { ]; return { - title: `${timeFormatter.format((transaction.time || 0) * 1000)}`, + title: `${timeFormatter.format((transaction.createdAt || 0) * 1000)}`, disabled: (isPaid && transaction.tag === "withdraw") || isExpired ||