diff options
author | Thomas <thomas.b.huang@gmail.com> | 2018-05-17 13:44:51 +0800 |
---|---|---|
committer | Thomas <thomas.b.huang@gmail.com> | 2018-05-17 13:44:51 +0800 |
commit | d9be7f989a86e3fdfd83e4c632fd08cefd8309e5 (patch) | |
tree | bbfeb7098997244ce7e8ce28e896faa2dfb6bb6e /ui/app/components/qr-code.js | |
parent | 06e25205b200b976e286c670cc5e703439dab05c (diff) | |
parent | f441153211c7920573f8bfb699bfda1b6de7efe9 (diff) | |
download | tangerine-wallet-browser-d9be7f989a86e3fdfd83e4c632fd08cefd8309e5.tar tangerine-wallet-browser-d9be7f989a86e3fdfd83e4c632fd08cefd8309e5.tar.gz tangerine-wallet-browser-d9be7f989a86e3fdfd83e4c632fd08cefd8309e5.tar.bz2 tangerine-wallet-browser-d9be7f989a86e3fdfd83e4c632fd08cefd8309e5.tar.lz tangerine-wallet-browser-d9be7f989a86e3fdfd83e4c632fd08cefd8309e5.tar.xz tangerine-wallet-browser-d9be7f989a86e3fdfd83e4c632fd08cefd8309e5.tar.zst tangerine-wallet-browser-d9be7f989a86e3fdfd83e4c632fd08cefd8309e5.zip |
Merge branch 'testing' of https://github.com/tmashuang/metamask-extension into testing
Diffstat (limited to 'ui/app/components/qr-code.js')
-rw-r--r-- | ui/app/components/qr-code.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ui/app/components/qr-code.js b/ui/app/components/qr-code.js index 83885539c..3b2c62f49 100644 --- a/ui/app/components/qr-code.js +++ b/ui/app/components/qr-code.js @@ -3,8 +3,9 @@ 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 { isHexPrefixed } = require('ethereumjs-util') const ReadOnlyInput = require('./readonly-input') +const { checksumAddress } = require('../util') module.exports = connect(mapStateToProps)(QrCodeView) @@ -24,16 +25,16 @@ function QrCodeView () { QrCodeView.prototype.render = function () { const props = this.props - const Qr = props.Qr - const address = `${isHexPrefixed(Qr.data) ? 'ethereum:' : ''}${Qr.data}` + const { message, data } = props.Qr + const address = `${isHexPrefixed(data) ? 'ethereum:' : ''}${data}` const qrImage = qrCode(4, 'M') qrImage.addData(address) qrImage.make() return h('.div.flex-column.flex-center', [ - Array.isArray(Qr.message) + Array.isArray(message) ? h('.message-container', this.renderMultiMessage()) - : Qr.message && h('.qr-header', Qr.message), + : message && h('.qr-header', message), this.props.warning ? this.props.warning && h('span.error.flex-center', { style: { @@ -50,7 +51,7 @@ QrCodeView.prototype.render = function () { h(ReadOnlyInput, { wrapperClass: 'ellip-address-wrapper', inputClass: 'qr-ellip-address', - value: Qr.data, + value: checksumAddress(data), }), ]) } |