1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00

Fix sorting and instances where something could be undefined

This commit is contained in:
Frankie 2017-01-11 16:27:05 -08:00
parent f9efb0817d
commit 34081c8cb2
3 changed files with 5 additions and 4 deletions

View File

@ -249,8 +249,9 @@ AccountDetailScreen.prototype.subview = function () {
AccountDetailScreen.prototype.transactionList = function () {
const {transactions, unconfMsgs, address, network, shapeShiftTxList } = this.props
// sort by recency
var soretedTxs = transactions.sort((a, b) => b.time - a.time)
return h(TransactionList, {
transactions,
transactions: soretedTxs,
network,
unconfMsgs,
address,

View File

@ -27,8 +27,8 @@ PTXP.render = function () {
var account = props.accounts[address]
var balance = account ? account.balance : '0x0'
var txFee = txData.txFee
var maxCost = txData.maxCost
var txFee = txData.txFee || ''
var maxCost = txData.maxCost || ''
var dataLength = txParams.data ? (txParams.data.length - 2) / 2 : 0
var imageify = props.imageifyIdenticons === undefined ? true : props.imageifyIdenticons

View File

@ -43,7 +43,7 @@ ConfirmTxScreen.prototype.render = function () {
var unconfMsgs = state.unconfMsgs
var unconfTxList = txHelper(unconfTxs, unconfMsgs, network)
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 isNotification = isPopupOrNotification() === 'notification'
return (