diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-10-27 07:40:13 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-10-27 07:40:13 +0800 |
commit | 3deeb6df0b1335ed68a20734516f3bff790f84b1 (patch) | |
tree | c2b388389b032b92eb2c7e6e63ce06df212650b4 | |
parent | c89ea954e52aab3ac1f0f00826eea9219f8d4731 (diff) | |
download | tangerine-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.
-rw-r--r-- | ui/app/reducers.js | 14 |
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) + } }) } |