Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
fix sequencing error in wallet creation
Browse files Browse the repository at this point in the history
fixes #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`
  • Loading branch information
mrose17 committed Sep 5, 2016
1 parent ac1dbc2 commit e165637
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
Expand Down Expand Up @@ -1047,6 +1048,8 @@ var getPaymentInfo = () => {
}

var setPaymentInfo = (amount) => {
if (!client) return

var bravery = client.getBraveryProperties()

amount = parseInt(amount, 10)
Expand Down

0 comments on commit e165637

Please sign in to comment.