From b1be3f4433a6705e727377d89b8bd541bfcef0a4 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Wed, 15 Aug 2018 11:29:58 +0200 Subject: [PATCH] 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 --- app/reducers/invoice.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/reducers/invoice.js b/app/reducers/invoice.js index 891a1f3e219..c4169b5d4b5 100644 --- a/app/reducers/invoice.js +++ b/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