From e165637b066c50f62af7dec961dea4ebf8c55018 Mon Sep 17 00:00:00 2001 From: Marshall Rose Date: Mon, 5 Sep 2016 15:40:29 -0700 Subject: [PATCH] fix sequencing error in wallet creation fixes https://github.com/brave/browser-laptop/issues/3742 - do not invoke `setPaymentInfo` if wallet not created; instead, on wallet creation, fetch current setting and use it! - also, remove redundant call to `getPaymentInfo` --- app/ledger.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/ledger.js b/app/ledger.js index 28f7eaf3ee4..65df794e121 100644 --- a/app/ledger.js +++ b/app/ledger.js @@ -363,7 +363,6 @@ var initialize = (onoff) => { // Make sure bravery props are up-to-date with user settings setPaymentInfo(getSetting(settings.PAYMENTS_CONTRIBUTION_AMOUNT)) - if (state.properties.wallet) getPaymentInfo() getBalance() }) return @@ -803,6 +802,8 @@ var callback = (err, result, delayTime) => { if (!result) return run(delayTime) if ((client) && (result.properties.wallet)) { + if (!ledgerInfo.created) setPaymentInfo(getSetting(settings.PAYMENTS_CONTRIBUTION_AMOUNT)) + getStateInfo(result) getPaymentInfo() } @@ -1047,6 +1048,8 @@ var getPaymentInfo = () => { } var setPaymentInfo = (amount) => { + if (!client) return + var bravery = client.getBraveryProperties() amount = parseInt(amount, 10)