aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/app/config.js4
-rw-r--r--ui/app/reducers.js17
2 files changed, 12 insertions, 9 deletions
diff --git a/ui/app/config.js b/ui/app/config.js
index 0fe232c07..9ba00b3dd 100644
--- a/ui/app/config.js
+++ b/ui/app/config.js
@@ -113,7 +113,9 @@ ConfigScreen.prototype.render = function () {
alignSelf: 'center',
},
onClick (event) {
- exportAsFile('MetaMask State Logs', window.logState())
+ window.logState((result) => {
+ exportAsFile('MetaMask State Logs', result)
+ })
},
}, 'Download State Logs'),
]),
diff --git a/ui/app/reducers.js b/ui/app/reducers.js
index 1224b4e92..385cafdfa 100644
--- a/ui/app/reducers.js
+++ b/ui/app/reducers.js
@@ -41,16 +41,17 @@ function rootReducer (state, action) {
return state
}
-window.logState = function () {
+window.logState = function (cb) {
let state = window.METAMASK_CACHED_LOG_STATE
const version = global.platform.getVersion()
- const browser = window.navigator.userAgent()
- const platform = global.platform.getPlatformInfo()
- state.version = version
- state.platform = platform
- state.browser = browser
- let stateString = JSON.stringify(state, removeSeedWords, 2)
- return stateString
+ const browser = window.navigator.userAgent
+ return global.platform.getPlatformInfo((platform) => {
+ state.version = version
+ state.platform = platform
+ state.browser = browser
+ let stateString = JSON.stringify(state, removeSeedWords, 2)
+ return cb(stateString)
+ })
}
function removeSeedWords (key, value) {