aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/reducers.js
diff options
context:
space:
mode:
authorKevin Serrano <kevin.serrano@consensys.net>2017-10-27 07:40:13 +0800
committerKevin Serrano <kevin.serrano@consensys.net>2017-10-27 07:40:13 +0800
commit3deeb6df0b1335ed68a20734516f3bff790f84b1 (patch)
treec2b388389b032b92eb2c7e6e63ce06df212650b4 /ui/app/reducers.js
parentc89ea954e52aab3ac1f0f00826eea9219f8d4731 (diff)
downloadtangerine-wallet-browser-3deeb6df0b1335ed68a20734516f3bff790f84b1.tar
tangerine-wallet-browser-3deeb6df0b1335ed68a20734516f3bff790f84b1.tar.gz
tangerine-wallet-browser-3deeb6df0b1335ed68a20734516f3bff790f84b1.tar.bz2
tangerine-wallet-browser-3deeb6df0b1335ed68a20734516f3bff790f84b1.tar.lz
tangerine-wallet-browser-3deeb6df0b1335ed68a20734516f3bff790f84b1.tar.xz
tangerine-wallet-browser-3deeb6df0b1335ed68a20734516f3bff790f84b1.tar.zst
tangerine-wallet-browser-3deeb6df0b1335ed68a20734516f3bff790f84b1.zip
Add option to copy directly to clipboard.
Diffstat (limited to 'ui/app/reducers.js')
-rw-r--r--ui/app/reducers.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/ui/app/reducers.js b/ui/app/reducers.js
index 3d0a58f81..05136f70f 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
@@ -57,9 +58,16 @@ window.logStateString = function (cb) {
})
}
-window.logState = function () {
- return window.logStateString((result) => {
- console.log(result)
+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)
+ }
})
}