mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix sorting and instances where something could be undefined
This commit is contained in:
parent
f9efb0817d
commit
34081c8cb2
@ -249,8 +249,9 @@ AccountDetailScreen.prototype.subview = function () {
|
|||||||
AccountDetailScreen.prototype.transactionList = function () {
|
AccountDetailScreen.prototype.transactionList = function () {
|
||||||
const {transactions, unconfMsgs, address, network, shapeShiftTxList } = this.props
|
const {transactions, unconfMsgs, address, network, shapeShiftTxList } = this.props
|
||||||
// sort by recency
|
// sort by recency
|
||||||
|
var soretedTxs = transactions.sort((a, b) => b.time - a.time)
|
||||||
return h(TransactionList, {
|
return h(TransactionList, {
|
||||||
transactions,
|
transactions: soretedTxs,
|
||||||
network,
|
network,
|
||||||
unconfMsgs,
|
unconfMsgs,
|
||||||
address,
|
address,
|
||||||
|
@ -27,8 +27,8 @@ PTXP.render = function () {
|
|||||||
var account = props.accounts[address]
|
var account = props.accounts[address]
|
||||||
var balance = account ? account.balance : '0x0'
|
var balance = account ? account.balance : '0x0'
|
||||||
|
|
||||||
var txFee = txData.txFee
|
var txFee = txData.txFee || ''
|
||||||
var maxCost = txData.maxCost
|
var maxCost = txData.maxCost || ''
|
||||||
var dataLength = txParams.data ? (txParams.data.length - 2) / 2 : 0
|
var dataLength = txParams.data ? (txParams.data.length - 2) / 2 : 0
|
||||||
var imageify = props.imageifyIdenticons === undefined ? true : props.imageifyIdenticons
|
var imageify = props.imageifyIdenticons === undefined ? true : props.imageifyIdenticons
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ ConfirmTxScreen.prototype.render = function () {
|
|||||||
var unconfMsgs = state.unconfMsgs
|
var unconfMsgs = state.unconfMsgs
|
||||||
var unconfTxList = txHelper(unconfTxs, unconfMsgs, network)
|
var unconfTxList = txHelper(unconfTxs, unconfMsgs, network)
|
||||||
var index = state.index !== undefined ? state.index : 0
|
var index = state.index !== undefined ? state.index : 0
|
||||||
var txData = unconfTxList[index] || unconfTxList[0] || {}
|
var txData = unconfTxList[index] || unconfTxList[0] || {txParams: {}}
|
||||||
var txParams = txData.txParams || {}
|
var txParams = txData.txParams || {}
|
||||||
var isNotification = isPopupOrNotification() === 'notification'
|
var isNotification = isPopupOrNotification() === 'notification'
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user