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
}
getPlatformInfo () {
return extension.runtime.getPlatformInfo()
getPlatformInfo (cb) {
return extension.runtime.getPlatformInfo(cb)
}
}

View File

@ -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'),
]),

View File

@ -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) {