From 3d80565339f02e1fa3e4bc0f8aaedbeea663a712 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 4 Oct 2017 10:55:10 -0700 Subject: Configured for callback-required function.' --- ui/app/config.js | 4 +++- ui/app/reducers.js | 17 +++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'ui') 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) { -- cgit