Browse Source
Merge pull request #348 from Empact/enhance/invoice-expiry
Exclude expired invoices from the pending activity view
renovate/lint-staged-8.x
Ben Woosley
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
1 deletions
-
app/reducers/activity.js
|
|
@ -107,6 +107,11 @@ const invoicesSelector = state => state.invoice.invoices |
|
|
|
const transactionsSelector = state => state.transaction.transactions |
|
|
|
const channelsSelector = state => state.channels.channels |
|
|
|
|
|
|
|
const invoiceExpired = (invoice) => { |
|
|
|
const expiresAt = (parseInt(invoice.creation_date, 10) + parseInt(invoice.expiry, 10)) |
|
|
|
return expiresAt < (Date.now() / 1000) |
|
|
|
} |
|
|
|
|
|
|
|
const allActivity = createSelector( |
|
|
|
searchSelector, |
|
|
|
paymentsSelector, |
|
|
@ -163,7 +168,7 @@ const sentActivity = createSelector( |
|
|
|
|
|
|
|
const pendingActivity = createSelector( |
|
|
|
invoicesSelector, |
|
|
|
invoices => invoices.filter(invoice => !invoice.settled) |
|
|
|
invoices => invoices.filter(invoice => !invoice.settled && !invoiceExpired(invoice)) |
|
|
|
) |
|
|
|
|
|
|
|
const fundedActivity = createSelector( |
|
|
|