Fix sorting and instances where something could be undefined

feature/default_network_editable
Frankie 8 years ago
parent f9efb0817d
commit 34081c8cb2
  1. 3
      ui/app/account-detail.js
  2. 4
      ui/app/components/pending-tx-details.js
  3. 2
      ui/app/conf-tx.js

@ -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…
Cancel
Save