diff options
author | Frankie <frankie.diamond@gmail.com> | 2017-01-12 08:27:05 +0800 |
---|---|---|
committer | Frankie <frankie.diamond@gmail.com> | 2017-01-12 09:02:57 +0800 |
commit | 34081c8cb2635bba0d6dd8a93d381f6554faa861 (patch) | |
tree | 5ef0cefddce1f7a2da0affec9b46f2b744610f0c | |
parent | f9efb0817d884fee22817c9a622e6583ef08e5da (diff) | |
download | tangerine-wallet-browser-34081c8cb2635bba0d6dd8a93d381f6554faa861.tar tangerine-wallet-browser-34081c8cb2635bba0d6dd8a93d381f6554faa861.tar.gz tangerine-wallet-browser-34081c8cb2635bba0d6dd8a93d381f6554faa861.tar.bz2 tangerine-wallet-browser-34081c8cb2635bba0d6dd8a93d381f6554faa861.tar.lz tangerine-wallet-browser-34081c8cb2635bba0d6dd8a93d381f6554faa861.tar.xz tangerine-wallet-browser-34081c8cb2635bba0d6dd8a93d381f6554faa861.tar.zst tangerine-wallet-browser-34081c8cb2635bba0d6dd8a93d381f6554faa861.zip |
Fix sorting and instances where something could be undefined
-rw-r--r-- | ui/app/account-detail.js | 3 | ||||
-rw-r--r-- | ui/app/components/pending-tx-details.js | 4 | ||||
-rw-r--r-- | ui/app/conf-tx.js | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index cfc59d99b..76554472e 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -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, diff --git a/ui/app/components/pending-tx-details.js b/ui/app/components/pending-tx-details.js index c40cd01b1..286931f6f 100644 --- a/ui/app/components/pending-tx-details.js +++ b/ui/app/components/pending-tx-details.js @@ -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 diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js index 79699965b..2c5ba5618 100644 --- a/ui/app/conf-tx.js +++ b/ui/app/conf-tx.js @@ -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 ( |