mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add option to copy directly to clipboard.
This commit is contained in:
parent
c89ea954e5
commit
3deeb6df0b
@ -1,4 +1,5 @@
|
|||||||
const extend = require('xtend')
|
const extend = require('xtend')
|
||||||
|
const copyToClipboard = require('copy-to-clipboard')
|
||||||
|
|
||||||
//
|
//
|
||||||
// Sub-Reducers take in the complete state and return their sub-state
|
// Sub-Reducers take in the complete state and return their sub-state
|
||||||
@ -57,9 +58,16 @@ window.logStateString = function (cb) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
window.logState = function () {
|
window.logState = function (toClipboard) {
|
||||||
return window.logStateString((result) => {
|
return window.logStateString((err, result) => {
|
||||||
console.log(result)
|
if (err) {
|
||||||
|
console.error(err.message)
|
||||||
|
} else if (toClipboard) {
|
||||||
|
copyToClipboard(result)
|
||||||
|
console.log('State log copied')
|
||||||
|
} else {
|
||||||
|
console.log(result)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user