aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app
diff options
context:
space:
mode:
authorChi Kei Chan <chikeichan@gmail.com>2017-11-16 04:03:13 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-11-16 04:03:13 +0800
commite61ba93194fe1bfb5fd2644951eebb3f3369f4ad (patch)
treedf23cb13d13e345bbbc3a904fb9161570bdd2d6d /ui/app
parentf8d38f44c2612f0f291063814ec0e98bb4aaf4bb (diff)
parent707a10548d4c6f1574395c7d72f432fa65d6fb9a (diff)
downloadtangerine-wallet-browser-e61ba93194fe1bfb5fd2644951eebb3f3369f4ad.tar
tangerine-wallet-browser-e61ba93194fe1bfb5fd2644951eebb3f3369f4ad.tar.gz
tangerine-wallet-browser-e61ba93194fe1bfb5fd2644951eebb3f3369f4ad.tar.bz2
tangerine-wallet-browser-e61ba93194fe1bfb5fd2644951eebb3f3369f4ad.tar.lz
tangerine-wallet-browser-e61ba93194fe1bfb5fd2644951eebb3f3369f4ad.tar.xz
tangerine-wallet-browser-e61ba93194fe1bfb5fd2644951eebb3f3369f4ad.tar.zst
tangerine-wallet-browser-e61ba93194fe1bfb5fd2644951eebb3f3369f4ad.zip
Merge branch 'master' into merge-master
Diffstat (limited to 'ui/app')
-rw-r--r--ui/app/accounts/import/index.js1
-rw-r--r--ui/app/reducers.js37
-rw-r--r--ui/app/reducers/app.js1
3 files changed, 29 insertions, 10 deletions
diff --git a/ui/app/accounts/import/index.js b/ui/app/accounts/import/index.js
index c66dcfc66..b7d9a9537 100644
--- a/ui/app/accounts/import/index.js
+++ b/ui/app/accounts/import/index.js
@@ -75,6 +75,7 @@ AccountImportSubview.prototype.render = function () {
}
}),
onChange: (opt) => {
+ props.dispatch(actions.showImportPage())
this.setState({ type: opt.value })
},
}),
diff --git a/ui/app/reducers.js b/ui/app/reducers.js
index e1a890535..70b7e71dc 100644
--- a/ui/app/reducers.js
+++ b/ui/app/reducers.js
@@ -1,4 +1,5 @@
const extend = require('xtend')
+const copyToClipboard = require('copy-to-clipboard')
//
// Sub-Reducers take in the complete state and return their sub-state
@@ -41,17 +42,33 @@ function rootReducer (state, action) {
return state
}
-window.logState = function () {
+window.logStateString = function (cb) {
const state = window.METAMASK_CACHED_LOG_STATE
- let version
- try {
- version = global.platform.getVersion()
- } catch (e) {
- version = 'unable to load version.'
- }
- state.version = version
- const stateString = JSON.stringify(state, removeSeedWords, 2)
- return stateString
+ const version = global.platform.getVersion()
+ const browser = window.navigator.userAgent
+ return global.platform.getPlatformInfo((err, platform) => {
+ if (err) {
+ return cb(err)
+ }
+ state.version = version
+ state.platform = platform
+ state.browser = browser
+ const stateString = JSON.stringify(state, removeSeedWords, 2)
+ return cb(null, stateString)
+ })
+}
+
+window.logState = function (toClipboard) {
+ return window.logStateString((err, result) => {
+ if (err) {
+ console.error(err.message)
+ } else if (toClipboard) {
+ copyToClipboard(result)
+ console.log('State log copied')
+ } else {
+ console.log(result)
+ }
+ })
}
function removeSeedWords (key, value) {
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js
index d84f264c9..3a4fb536d 100644
--- a/ui/app/reducers/app.js
+++ b/ui/app/reducers/app.js
@@ -175,6 +175,7 @@ function reduceApp (state, action) {
name: 'import-menu',
},
transForward: true,
+ warning: null,
})
case actions.SHOW_INFO_PAGE: