mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add alternate UI for pending personal_sign messages
This commit is contained in:
parent
564f920ae0
commit
7ec25526b7
@ -33,6 +33,7 @@ module.exports = class MessageManager extends EventEmitter{
|
||||
msgParams: msgParams,
|
||||
time: time,
|
||||
status: 'unapproved',
|
||||
type: 'eth_sign',
|
||||
}
|
||||
this.addMsg(msgData)
|
||||
|
||||
@ -115,4 +116,4 @@ function normalizeMsgData(data) {
|
||||
// data is unicode, convert to hex
|
||||
return ethUtil.bufferToHex(new Buffer(data, 'utf8'))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ module.exports = class MessageManager extends EventEmitter{
|
||||
msgParams: msgParams,
|
||||
time: time,
|
||||
status: 'unapproved',
|
||||
type: 'personal_sign',
|
||||
}
|
||||
this.addMsg(msgData)
|
||||
|
||||
|
@ -28,15 +28,6 @@ PendingMsg.prototype.render = function () {
|
||||
},
|
||||
}, 'Sign Message'),
|
||||
|
||||
h('.error', {
|
||||
style: {
|
||||
margin: '10px',
|
||||
},
|
||||
}, `Signing this message can have
|
||||
dangerous side effects. Only sign messages from
|
||||
sites you fully trust with your entire account.
|
||||
This will be fixed in a future version.`),
|
||||
|
||||
// message details
|
||||
h(PendingTxDetails, state),
|
||||
|
||||
|
@ -118,18 +118,25 @@ ConfirmTxScreen.prototype.render = function () {
|
||||
}
|
||||
|
||||
function currentTxView (opts) {
|
||||
const { txData } = opts
|
||||
const { txParams, msgParams } = txData
|
||||
|
||||
log.info('rendering current tx view')
|
||||
const { txData } = opts
|
||||
const { txParams, msgParams, type } = txData
|
||||
|
||||
if (txParams) {
|
||||
// This is a pending transaction
|
||||
log.debug('txParams detected, rendering pending tx')
|
||||
return h(PendingTx, opts)
|
||||
|
||||
} else if (msgParams) {
|
||||
// This is a pending message to sign
|
||||
log.debug('msgParams detected, rendering pending msg')
|
||||
return h(PendingMsg, opts)
|
||||
|
||||
if (type === 'eth_sign') {
|
||||
log.debug('rendering eth_sign message')
|
||||
return h(PendingMsg, opts)
|
||||
|
||||
} else if (type === 'personal_sign') {
|
||||
log.debug('rendering personal_sign message')
|
||||
return h(PendingPersonalMsg, opts)
|
||||
}
|
||||
}
|
||||
}
|
||||
ConfirmTxScreen.prototype.checkBalanceAgainstTx = function (txData) {
|
||||
|
Loading…
Reference in New Issue
Block a user