From 9653dafb075913383b5fe8901faa4cd5ac8c085c Mon Sep 17 00:00:00 2001 From: Marshall Rose Date: Thu, 17 Nov 2016 15:07:27 -0800 Subject: [PATCH] do not count a transaction-in-progress as a transaction... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/brave/browser-laptop/issues/5371 Fixes https://github.com/brave/browser-laptop/issues/5441 (i can’t reproduce it — neither could @ayumi — but i cleaned up a little bit of logic to make it easier to follow. --- app/ledger.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/ledger.js b/app/ledger.js index 57a28c4fb5c..c15163bfee0 100644 --- a/app/ledger.js +++ b/app/ledger.js @@ -1234,6 +1234,8 @@ var getStateInfo = (state) => { transaction = state.transactions[i] if (transaction.stamp < then) break + if ((!transaction.ballots) || (transaction.ballots.length < transaction.count)) continue + ballots = underscore.clone(transaction.ballots || {}) state.ballots.forEach((ballot) => { if (ballot.viewingId !== transaction.viewingId) return @@ -1462,10 +1464,9 @@ var pathName = (name) => { */ const showNotifications = () => { - if (getSetting(settings.PAYMENTS_ENABLED) && - getSetting(settings.PAYMENTS_NOTIFICATIONS)) { - showEnabledNotifications() - } else if (!getSetting(settings.PAYMENTS_ENABLED)) { + if (getSetting(settings.PAYMENTS_ENABLED)) { + if (getSetting(settings.PAYMENTS_NOTIFICATIONS)) showEnabledNotifications() + } else { showDisabledNotifications() } }