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

Revert "updateledgerinfo refactor" #3471

Merged
merged 1 commit into from
Aug 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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