diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-10-10 23:36:15 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-10-10 23:36:15 +0800 |
commit | 24a55cf7770a6154fe723cf13cdc9998e1759f3b (patch) | |
tree | aa948c2dca68eb3f609390ccba809704ece4363b /ui/app | |
parent | f6821781d2ee3b1562008f47d9581ed21efee3ef (diff) | |
download | tangerine-wallet-browser-24a55cf7770a6154fe723cf13cdc9998e1759f3b.tar tangerine-wallet-browser-24a55cf7770a6154fe723cf13cdc9998e1759f3b.tar.gz tangerine-wallet-browser-24a55cf7770a6154fe723cf13cdc9998e1759f3b.tar.bz2 tangerine-wallet-browser-24a55cf7770a6154fe723cf13cdc9998e1759f3b.tar.lz tangerine-wallet-browser-24a55cf7770a6154fe723cf13cdc9998e1759f3b.tar.xz tangerine-wallet-browser-24a55cf7770a6154fe723cf13cdc9998e1759f3b.tar.zst tangerine-wallet-browser-24a55cf7770a6154fe723cf13cdc9998e1759f3b.zip |
Make the function callback friendly.
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/config.js | 8 | ||||
-rw-r--r-- | ui/app/reducers.js | 7 |
2 files changed, 11 insertions, 4 deletions
diff --git a/ui/app/config.js b/ui/app/config.js index 75c3bcf13..c14fa1d28 100644 --- a/ui/app/config.js +++ b/ui/app/config.js @@ -113,8 +113,12 @@ ConfigScreen.prototype.render = function () { alignSelf: 'center', }, onClick (event) { - window.logStateString((result) => { - exportAsFile('MetaMask State Logs', result) + window.logStateString((err, result) => { + if (err) { + state.dispatch(actions.displayWarning('Error in retrieving state logs.')) + } else { + exportAsFile('MetaMask State Logs', result) + } }) }, }, 'Download State Logs'), diff --git a/ui/app/reducers.js b/ui/app/reducers.js index 0af7ee81c..3d0a58f81 100644 --- a/ui/app/reducers.js +++ b/ui/app/reducers.js @@ -45,12 +45,15 @@ window.logStateString = function (cb) { let state = window.METAMASK_CACHED_LOG_STATE const version = global.platform.getVersion() const browser = window.navigator.userAgent - return global.platform.getPlatformInfo((platform) => { + return global.platform.getPlatformInfo((err, platform) => { + if (err) { + return cb(err) + } state.version = version state.platform = platform state.browser = browser let stateString = JSON.stringify(state, removeSeedWords, 2) - return cb(stateString) + return cb(null, stateString) }) } |