1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Merge pull request #4640 from weijiekoh/develop

Fix for #4639: display values of EIP712 typed boolean fields in the signing prompt
This commit is contained in:
Dan J Miller 2018-06-29 17:00:51 -02:30 committed by GitHub
commit 22debbfec8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -34,9 +34,13 @@ TypedMessageRenderer.prototype.render = function () {
function renderTypedData (values) { function renderTypedData (values) {
return values.map(function (value) { return values.map(function (value) {
let v = value.value
if (typeof v === 'boolean') {
v = v.toString()
}
return h('div', {}, [ return h('div', {}, [
h('strong', {style: {display: 'block', fontWeight: 'bold'}}, String(value.name) + ':'), h('strong', {style: {display: 'block', fontWeight: 'bold'}}, String(value.name) + ':'),
h('div', {}, value.value), h('div', {}, v),
]) ])
}) })
} }

View File

@ -204,6 +204,9 @@ SignatureRequest.prototype.renderBody = function () {
h('div.request-signature__rows', [ h('div.request-signature__rows', [
...rows.map(({ name, value }) => { ...rows.map(({ name, value }) => {
if (typeof value === 'boolean') {
value = value.toString()
}
return h('div.request-signature__row', [ return h('div.request-signature__row', [
h('div.request-signature__row-title', [`${name}:`]), h('div.request-signature__row-title', [`${name}:`]),
h('div.request-signature__row-value', value), h('div.request-signature__row-value', value),