Browse Source

Add access to db,commands,store in the console

gre-patch-1
Gaëtan Renaudeau 6 years ago
parent
commit
2a6dc63487
No known key found for this signature in database GPG Key ID: 7B66B85F042E5451
  1. 3
      src/commands/index.js
  2. 9
      src/renderer/init.js

3
src/commands/index.js

@ -69,8 +69,11 @@ const all: Array<Command<any, any>> = [
uninstallApp,
]
export const commandsById = {}
all.forEach(cmd => {
invariant(!all.some(c => c !== cmd && c.id === cmd.id), `duplicate command '${cmd.id}'`)
commandsById[cmd.id] = cmd
})
export default all

9
src/renderer/init.js

@ -18,6 +18,7 @@ import { fetchAccounts } from 'actions/accounts'
import { fetchSettings } from 'actions/settings'
import { lock } from 'reducers/application'
import { languageSelector, sentryLogsSelector } from 'reducers/settings'
import { commandsById } from 'commands'
import libcoreGetVersion from 'commands/libcoreGetVersion'
import resolveUserDataDirectory from 'helpers/resolveUserDataDirectory'
@ -111,6 +112,14 @@ async function init() {
},
false,
)
// expose stuff in Windows for DEBUG purpose
window.ledger = {
commands: commandsById,
store,
db,
}
}
function r(Comp) {

Loading…
Cancel
Save