diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-07-16 08:51:37 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-07-16 08:51:37 +0800 |
commit | 203a56fb92dd51d41fa9dbc145ba5a912f27c6db (patch) | |
tree | cd347d027771a5b2be86abc6459ea73c23e4ef6b /ui/app | |
parent | c4812b3452da96c0196da4ea39ac3080b59078cb (diff) | |
download | tangerine-wallet-browser-203a56fb92dd51d41fa9dbc145ba5a912f27c6db.tar tangerine-wallet-browser-203a56fb92dd51d41fa9dbc145ba5a912f27c6db.tar.gz tangerine-wallet-browser-203a56fb92dd51d41fa9dbc145ba5a912f27c6db.tar.bz2 tangerine-wallet-browser-203a56fb92dd51d41fa9dbc145ba5a912f27c6db.tar.lz tangerine-wallet-browser-203a56fb92dd51d41fa9dbc145ba5a912f27c6db.tar.xz tangerine-wallet-browser-203a56fb92dd51d41fa9dbc145ba5a912f27c6db.tar.zst tangerine-wallet-browser-203a56fb92dd51d41fa9dbc145ba5a912f27c6db.zip |
Add ui state logging function
Now from the UI console, you can always call `logState()`, and it will print the state stringified into the console, ready to drop into the ui dev mode states folder, or other inspection.
This should make it easier to diagnose user bugs in the future.
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/reducers.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/app/reducers.js b/ui/app/reducers.js index 9243ddba4..a691cf614 100644 --- a/ui/app/reducers.js +++ b/ui/app/reducers.js @@ -7,6 +7,8 @@ const reduceIdentities = require('./reducers/identities') const reduceMetamask = require('./reducers/metamask') const reduceApp = require('./reducers/app') +window.METAMASK_CACHED_LOG_STATE = null + module.exports = rootReducer function rootReducer (state, action) { @@ -35,5 +37,11 @@ function rootReducer (state, action) { state.appState = reduceApp(state, action) + window.METAMASK_CACHED_LOG_STATE = state return state } + +window.logState = function() { + var stateString = JSON.stringify(window.METAMASK_CACHED_LOG_STATE, null, 2) + console.log(stateString) +} |