1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Configured for callback-required function.'

This commit is contained in:
Kevin Serrano 2017-10-04 10:55:10 -07:00
parent e64c64a049
commit 3d80565339
No known key found for this signature in database
GPG Key ID: BF999DEFC7371BA1
3 changed files with 14 additions and 11 deletions

View File

@ -17,8 +17,8 @@ class ExtensionPlatform {
return extension.runtime.getManifest().version return extension.runtime.getManifest().version
} }
getPlatformInfo () { getPlatformInfo (cb) {
return extension.runtime.getPlatformInfo() return extension.runtime.getPlatformInfo(cb)
} }
} }

View File

@ -113,7 +113,9 @@ ConfigScreen.prototype.render = function () {
alignSelf: 'center', alignSelf: 'center',
}, },
onClick (event) { onClick (event) {
exportAsFile('MetaMask State Logs', window.logState()) window.logState((result) => {
exportAsFile('MetaMask State Logs', result)
})
}, },
}, 'Download State Logs'), }, 'Download State Logs'),
]), ]),

View File

@ -41,16 +41,17 @@ function rootReducer (state, action) {
return state return state
} }
window.logState = function () { window.logState = function (cb) {
let state = window.METAMASK_CACHED_LOG_STATE let state = window.METAMASK_CACHED_LOG_STATE
const version = global.platform.getVersion() const version = global.platform.getVersion()
const browser = window.navigator.userAgent() const browser = window.navigator.userAgent
const platform = global.platform.getPlatformInfo() return global.platform.getPlatformInfo((platform) => {
state.version = version state.version = version
state.platform = platform state.platform = platform
state.browser = browser state.browser = browser
let stateString = JSON.stringify(state, removeSeedWords, 2) let stateString = JSON.stringify(state, removeSeedWords, 2)
return stateString return cb(stateString)
})
} }
function removeSeedWords (key, value) { function removeSeedWords (key, value) {