diff options
author | kumavis <kumavis@users.noreply.github.com> | 2018-10-30 09:57:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-30 09:57:51 +0800 |
commit | 73eeeda2157e8a7ef61ff1f1fd0f4b94821f2e6f (patch) | |
tree | 51b163f772d253b8e56588fd254ca918a8b058a2 /ui | |
parent | 310229d22e5e916e8d6e3b1a469b9b196e0f70c2 (diff) | |
parent | 7ae5a23b6c0e9839f63bba52ab5bf7da00bef173 (diff) | |
download | tangerine-wallet-browser-73eeeda2157e8a7ef61ff1f1fd0f4b94821f2e6f.tar.gz tangerine-wallet-browser-73eeeda2157e8a7ef61ff1f1fd0f4b94821f2e6f.tar.zst tangerine-wallet-browser-73eeeda2157e8a7ef61ff1f1fd0f4b94821f2e6f.zip |
Merge pull request #5560 from MetaMask/sentry-enhancements2
Sentry - various enhancements to help debugging (alternate)
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/reducers.js | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/ui/app/reducers.js b/ui/app/reducers.js index 80e76d570..e1a982f93 100644 --- a/ui/app/reducers.js +++ b/ui/app/reducers.js @@ -1,3 +1,4 @@ +const clone = require('clone') const extend = require('xtend') const copyToClipboard = require('copy-to-clipboard') @@ -52,19 +53,24 @@ function rootReducer (state, action) { return state } +window.getCleanAppState = function () { + const state = clone(window.METAMASK_CACHED_LOG_STATE) + // append additional information + state.version = global.platform.getVersion() + state.browser = window.navigator.userAgent + // ensure seedWords are not included + if (state.metamask) delete state.metamask.seedWords + if (state.appState.currentView) delete state.appState.currentView.seedWords + return state +} + window.logStateString = function (cb) { - const state = window.METAMASK_CACHED_LOG_STATE - const version = global.platform.getVersion() - const browser = window.navigator.userAgent - return global.platform.getPlatformInfo((err, platform) => { - if (err) { - return cb(err) - } - state.version = version + const state = window.getCleanAppState() + global.platform.getPlatformInfo((err, platform) => { + if (err) return cb(err) state.platform = platform - state.browser = browser const stateString = JSON.stringify(state, removeSeedWords, 2) - return cb(null, stateString) + cb(null, stateString) }) } |