Skip to content

Commit

Permalink
Fixes publishers migration with disabled wallet
Browse files Browse the repository at this point in the history
Resolves brave#11614

Auditors:

Test Plan:
  • Loading branch information
NejcZdovc committed Oct 23, 2017
1 parent 3e53054 commit d037100
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/browser/api/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,10 @@ const enable = (state, paymentsEnabled) => {
}
})

if (!ledgerState.getPublishers(state).isEmpty()) {
state = synopsisNormalizer(state, null, true)
}

return state
}

Expand Down Expand Up @@ -2200,7 +2204,7 @@ const migration = (state) => {

const synopsisOptions = ledgerState.getSynopsisOptions(state)

if (getSetting(settings.PAYMENTS_ENABLED) && synopsisOptions.isEmpty()) {
if (synopsisOptions.isEmpty()) {
// Move data from synopsis file into appState
const fs = require('fs')
try {
Expand Down Expand Up @@ -2316,7 +2320,8 @@ const transitionWalletToBat = () => {
newClient = ledgerClient(null, underscore.extend({roundtrip: roundtrip}, clientOptions), null)
muonWriter(newClientPath, newClient.state)
} catch (ex) {
return console.error('ledger client creation error(2): ', ex)
console.error('ledger client creation error(2): ', ex)
return
}
}

Expand Down

0 comments on commit d037100

Please sign in to comment.