aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/qr-code.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-06-13 08:06:39 +0800
committerDan Finlay <dan@danfinlay.com>2017-06-13 08:17:16 +0800
commita741cc4fc4fb68e3f460c70ea848bdf3d2d2c894 (patch)
tree58652d4789e71a47a763096e746bd25904d91bfe /ui/app/components/qr-code.js
parentd05d9a5f57b9311d6f29539233f9065330e8bda4 (diff)
parentbbe0c73dca45542b519036bec2bae5feb1e55485 (diff)
downloadtangerine-wallet-browser-a741cc4fc4fb68e3f460c70ea848bdf3d2d2c894.tar.gz
tangerine-wallet-browser-a741cc4fc4fb68e3f460c70ea848bdf3d2d2c894.tar.zst
tangerine-wallet-browser-a741cc4fc4fb68e3f460c70ea848bdf3d2d2c894.zip
Merge branch 'master' into AddTokenList
Diffstat (limited to 'ui/app/components/qr-code.js')
-rw-r--r--ui/app/components/qr-code.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/ui/app/components/qr-code.js b/ui/app/components/qr-code.js
index 5488599eb..06b9aed9b 100644
--- a/ui/app/components/qr-code.js
+++ b/ui/app/components/qr-code.js
@@ -3,6 +3,7 @@ const h = require('react-hyperscript')
const qrCode = require('qrcode-npm').qrcode
const inherits = require('util').inherits
const connect = require('react-redux').connect
+const isHexPrefixed = require('ethereumjs-util').isHexPrefixed
const CopyButton = require('./copyButton')
module.exports = connect(mapStateToProps)(QrCodeView)
@@ -22,13 +23,12 @@ function QrCodeView () {
}
QrCodeView.prototype.render = function () {
- var props = this.props
- var Qr = props.Qr
- var qrImage = qrCode(4, 'M')
-
- qrImage.addData(Qr.data)
+ const props = this.props
+ const Qr = props.Qr
+ const address = `${isHexPrefixed(Qr.data) ? 'ethereum:' : ''}${Qr.data}`
+ const qrImage = qrCode(4, 'M')
+ qrImage.addData(address)
qrImage.make()
-
return h('.main-container.flex-column', {
key: 'qr',
style: {