aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-10-20 15:14:59 +0800
committerkumavis <aaron@kumavis.me>2018-10-20 15:14:59 +0800
commit73ec4e66cb7a476d01371a61692b0d8d9224da04 (patch)
tree96c2b2b20030e63eebbf0f08e669091968f1a223 /ui
parente3fda83ab209af7836ba93bfaba215c271d73e8a (diff)
downloadtangerine-wallet-browser-73ec4e66cb7a476d01371a61692b0d8d9224da04.tar
tangerine-wallet-browser-73ec4e66cb7a476d01371a61692b0d8d9224da04.tar.gz
tangerine-wallet-browser-73ec4e66cb7a476d01371a61692b0d8d9224da04.tar.bz2
tangerine-wallet-browser-73ec4e66cb7a476d01371a61692b0d8d9224da04.tar.lz
tangerine-wallet-browser-73ec4e66cb7a476d01371a61692b0d8d9224da04.tar.xz
tangerine-wallet-browser-73ec4e66cb7a476d01371a61692b0d8d9224da04.tar.zst
tangerine-wallet-browser-73ec4e66cb7a476d01371a61692b0d8d9224da04.zip
sentry - include app state in ui errors
Diffstat (limited to 'ui')
-rw-r--r--ui/app/reducers.js26
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)
})
}