Skip to content

Commit

Permalink
fix(getLastTransactionTimeLightning): add case for channel opening/no…
Browse files Browse the repository at this point in the history
… creationDate
  • Loading branch information
KayBeSee committed Oct 11, 2022
1 parent 23d3299 commit 4006baf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/frontend/src/pages/Home/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export const getLastTransactionTimeLightning = (events: LightningEvent[]) => {
if (!events || events.length === 0) {
// if no transactions yet
return `No activity on this account yet`;
} else if (!events[0].creationDate) {
return 'Last transaction was moments ago';
} else {
// if transaction is confirmed, give moments ago
return `Last transaction was ${moment.unix(Number(events[0].creationDate)).fromNow()}`;
Expand Down

0 comments on commit 4006baf

Please sign in to comment.