Browse Source

fix(invoice): only notify on settled invoices

Fix a bug where we were incorrectly notifying users that an invoice had
been successfully paid when it had actually just been created.

Fix #670
renovate/lint-staged-8.x
Tom Kirkpatrick 6 years ago
parent
commit
b1be3f4433
No known key found for this signature in database GPG Key ID: 72203A8EC5967EA8
  1. 10
      app/reducers/invoice.js

10
app/reducers/invoice.js

@ -136,11 +136,13 @@ export const invoiceUpdate = (event, { invoice }) => dispatch => {
// Fetch new balance
dispatch(fetchBalance())
// HTML 5 desktop notification for the invoice update
const notifTitle = "You've been Zapped"
const notifBody = 'Congrats, someone just paid an invoice of yours'
if (invoice.settled) {
// HTML 5 desktop notification for the invoice update
const notifTitle = "You've been Zapped"
const notifBody = 'Congrats, someone just paid an invoice of yours'
showNotification(notifTitle, notifBody)
showNotification(notifTitle, notifBody)
}
}
// ------------------------------------
// Action Handlers

Loading…
Cancel
Save