Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix(invoice): only notify on settled invoices
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mrfelton committed Aug 15, 2018
1 parent 1f20907 commit b1be3f4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/reducers/invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b1be3f4

Please sign in to comment.