1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00

fixed: showing tx-s as errors vs. warning

This commit is contained in:
frankiebee 2017-08-04 14:43:08 -04:00
parent cddff73703
commit fa3df576bc

View File

@ -154,12 +154,21 @@ function failIfFailed (transaction) {
if (transaction.status === 'rejected') {
return h('span.error', ' (Rejected)')
}
if (transaction.err) {
if (transaction.err || transaction.warning) {
const { err, warning = {} } = transaction
const errFirst = !!(( err && warning ) || err)
const message = errFirst ? err.message : warning.message
errFirst ? err.message : warning.message
return h(Tooltip, {
title: transaction.err.message,
title: message,
position: 'bottom',
}, [
h('span.error', ' (Failed)'),
h(`span.${errFirst ? 'error' : 'warning'}`,
` (${errFirst ? 'Failed' : 'Warning'})`
),
])
}
}