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

Commit

Permalink
Merge pull request #3471 from brave/revert-3430-fix/updateledgerinfo-…
Browse files Browse the repository at this point in the history
…refactor

Revert "updateledgerinfo refactor"
  • Loading branch information
bbondy authored Aug 27, 2016
2 parents ebedb6c + 5e5c862 commit ddd2878
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions app/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ var boot = () => {
if (err.code !== 'ENOENT') console.log('statePath read error: ' + err.toString())

ledgerInfo.creating = true
updateLedgerInfo()
appActions.updateLedgerInfo({ creating: true })
try {
client = ledgerClient(null, underscore.extend({ roundtrip: roundtrip }, clientOptions), null)
} catch (ex) {
resetLedgerInfo()
appActions.updateLedgerInfo({})

bootP = false
return console.log('ledger client boot error: ' + ex.toString() + '\n' + ex.stack)
Expand All @@ -162,7 +162,7 @@ if (ipc) {
ipc.on(messages.CHECK_BITCOIN_HANDLER, () => {
if (typeof protocolHandler.isNavigatorProtocolHandled === 'function') {
ledgerInfo.hasBitcoinHandler = protocolHandler.isNavigatorProtocolHandled('', 'bitcoin')
updateLedgerInfo()
appActions.updateLedgerInfo(underscore.omit(ledgerInfo, [ '_internal' ]))
}
})

Expand Down Expand Up @@ -331,8 +331,7 @@ var initialize = (onoff) => {

if (!onoff) {
client = null
resetLedgerInfo()
return
return appActions.updateLedgerInfo({})
}
if (client) return

Expand Down Expand Up @@ -375,7 +374,7 @@ var initialize = (onoff) => {
}

if (err.code !== 'ENOENT') console.log('statePath read error: ' + err.toString())
resetLedgerInfo()
appActions.updateLedgerInfo({})
})
}

Expand Down Expand Up @@ -751,10 +750,6 @@ var updateLedgerInfo = () => {
appActions.updateLedgerInfo(underscore.omit(ledgerInfo, [ '_internal' ]))
}

var resetLedgerInfo = () => {
appActions.updateLedgerInfo({})
}

/*
* ledger client callbacks
*/
Expand Down

0 comments on commit ddd2878

Please sign in to comment.