diff options
author | Dan <danjm.com@gmail.com> | 2017-10-26 08:28:56 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-26 08:40:48 +0800 |
commit | ddf11011c9467209e6b9810dff2df84ea9e4a040 (patch) | |
tree | d286b54c776c132534e520ad177f278c617931b3 /ui/app/components/signature-request.js | |
parent | 39d4fe311f694a659d1d1454159417719d552b9d (diff) | |
download | dexon-wallet-ddf11011c9467209e6b9810dff2df84ea9e4a040.tar.gz dexon-wallet-ddf11011c9467209e6b9810dff2df84ea9e4a040.tar.zst dexon-wallet-ddf11011c9467209e6b9810dff2df84ea9e4a040.zip |
Signature request fixes.
Diffstat (limited to 'ui/app/components/signature-request.js')
-rw-r--r-- | ui/app/components/signature-request.js | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/ui/app/components/signature-request.js b/ui/app/components/signature-request.js index 4df4f919..35a739a8 100644 --- a/ui/app/components/signature-request.js +++ b/ui/app/components/signature-request.js @@ -156,20 +156,24 @@ SignatureRequest.prototype.msgHexToText = function (hex) { SignatureRequest.prototype.renderBody = function () { let rows + let notice = 'You are signing:' const { txData } = this.props const { type, msgParams: { data } } = txData if (type === 'personal_sign') { - rows = [{ name: 'Message:', value: this.msgHexToText(data) }] + rows = [{ name: 'Message', value: this.msgHexToText(data) }] } else if (type === 'eth_signTypedData') { rows = data } - // given the warning in './pending-msg.js', eth_sign' has not been implemented on NewUI-flat at this time - // else if (type === 'eth_sign') { - // console.log('Not currently supported') - // } + else if (type === 'eth_sign') { + rows = [{ name: 'Message', value: data }] + notice = `Signing this message can have + dangerous side effects. Only sign messages from + sites you fully trust with your entire account. + This dangerous method will be removed in a future version. ` + } return h('div.request-signature__body', {}, [ @@ -177,7 +181,7 @@ SignatureRequest.prototype.renderBody = function () { this.renderRequestInfo(), - h('div.request-signature__notice', ['You are signing:']), + h('div.request-signature__notice', [notice]), h('div.request-signature__rows', [ @@ -200,6 +204,8 @@ SignatureRequest.prototype.renderFooter = function () { signTypedMessage, cancelPersonalMessage, cancelTypedMessage, + signMessage, + cancelMessage, } = this.props const { txData } = this.props @@ -215,6 +221,10 @@ SignatureRequest.prototype.renderFooter = function () { cancel = cancelTypedMessage sign = signTypedMessage } + else if (type === 'eth_sign') { + cancel = cancelMessage + sign = signMessage + } return h('div.request-signature__footer', [ h('div.request-signature__footer__cancel-button', { |