aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEsteban MIno <efmino@uc.cl>2018-08-31 00:51:57 +0800
committerEsteban MIno <efmino@uc.cl>2018-08-31 00:51:57 +0800
commitc8e5068537b6f0fa0f68752f246058d2c24cb4b8 (patch)
tree3703f987487eafcc3a5fb540cc0d0a38eef56317
parent208312b239355194de13989a3ede57e8d7393949 (diff)
downloadtangerine-wallet-browser-c8e5068537b6f0fa0f68752f246058d2c24cb4b8.tar
tangerine-wallet-browser-c8e5068537b6f0fa0f68752f246058d2c24cb4b8.tar.gz
tangerine-wallet-browser-c8e5068537b6f0fa0f68752f246058d2c24cb4b8.tar.bz2
tangerine-wallet-browser-c8e5068537b6f0fa0f68752f246058d2c24cb4b8.tar.lz
tangerine-wallet-browser-c8e5068537b6f0fa0f68752f246058d2c24cb4b8.tar.xz
tangerine-wallet-browser-c8e5068537b6f0fa0f68752f246058d2c24cb4b8.tar.zst
tangerine-wallet-browser-c8e5068537b6f0fa0f68752f246058d2c24cb4b8.zip
fix watched tokens images showing in tx list
-rw-r--r--ui/app/components/transaction-list-item/transaction-list-item.component.js3
-rw-r--r--ui/app/components/transaction-list/transaction-list.component.js8
-rw-r--r--ui/app/components/transaction-list/transaction-list.container.js3
-rw-r--r--ui/app/selectors.js6
4 files changed, 16 insertions, 4 deletions
diff --git a/ui/app/components/transaction-list-item/transaction-list-item.component.js b/ui/app/components/transaction-list-item/transaction-list-item.component.js
index d9e63d6e0..4fddd45ef 100644
--- a/ui/app/components/transaction-list-item/transaction-list-item.component.js
+++ b/ui/app/components/transaction-list-item/transaction-list-item.component.js
@@ -21,6 +21,7 @@ export default class TransactionListItem extends PureComponent {
setSelectedToken: PropTypes.func,
nonceAndDate: PropTypes.string,
token: PropTypes.object,
+ assetImages: PropTypes.object,
}
handleClick = () => {
@@ -100,6 +101,7 @@ export default class TransactionListItem extends PureComponent {
methodData,
showRetry,
nonceAndDate,
+ assetImages,
} = this.props
const { txParams = {} } = transaction
@@ -113,6 +115,7 @@ export default class TransactionListItem extends PureComponent {
className="transaction-list-item__identicon"
address={txParams.to}
diameter={34}
+ image={assetImages[txParams.to]}
/>
<TransactionAction
transaction={transaction}
diff --git a/ui/app/components/transaction-list/transaction-list.component.js b/ui/app/components/transaction-list/transaction-list.component.js
index e30476d8c..79d9d1445 100644
--- a/ui/app/components/transaction-list/transaction-list.component.js
+++ b/ui/app/components/transaction-list/transaction-list.component.js
@@ -21,6 +21,7 @@ export default class TransactionList extends PureComponent {
transactionToRetry: PropTypes.object,
selectedToken: PropTypes.object,
updateNetworkNonce: PropTypes.func,
+ assetImages: PropTypes.object,
}
componentDidMount () {
@@ -44,8 +45,8 @@ export default class TransactionList extends PureComponent {
renderTransactions () {
const { t } = this.context
- const { pendingTransactions = [], completedTransactions = [] } = this.props
-
+ const { pendingTransactions = [], completedTransactions = [], assetImages } = this.props
+ console.log('REMDERING FROM TX LIST', assetImages)
return (
<div className="transaction-list__transactions">
{
@@ -79,7 +80,7 @@ export default class TransactionList extends PureComponent {
}
renderTransaction (transaction, index) {
- const { selectedToken } = this.props
+ const { selectedToken, assetImages } = this.props
return transaction.key === TRANSACTION_TYPE_SHAPESHIFT
? (
@@ -93,6 +94,7 @@ export default class TransactionList extends PureComponent {
key={transaction.id}
showRetry={this.shouldShowRetry(transaction)}
token={selectedToken}
+ assetImages={assetImages}
/>
)
}
diff --git a/ui/app/components/transaction-list/transaction-list.container.js b/ui/app/components/transaction-list/transaction-list.container.js
index 1ec1f9ccf..2e946c67d 100644
--- a/ui/app/components/transaction-list/transaction-list.container.js
+++ b/ui/app/components/transaction-list/transaction-list.container.js
@@ -7,7 +7,7 @@ import {
submittedPendingTransactionsSelector,
completedTransactionsSelector,
} from '../../selectors/transactions'
-import { getSelectedAddress } from '../../selectors'
+import { getSelectedAddress, getAssetImages } from '../../selectors'
import { selectedTokenSelector } from '../../selectors/tokens'
import { getLatestSubmittedTxWithNonce } from '../../helpers/transactions.util'
import { updateNetworkNonce } from '../../actions'
@@ -23,6 +23,7 @@ const mapStateToProps = state => {
transactionToRetry: getLatestSubmittedTxWithNonce(submittedPendingTransactions, networkNonce),
selectedToken: selectedTokenSelector(state),
selectedAddress: getSelectedAddress(state),
+ assetImages: getAssetImages(state),
}
}
diff --git a/ui/app/selectors.js b/ui/app/selectors.js
index 484705b1f..18d6709f7 100644
--- a/ui/app/selectors.js
+++ b/ui/app/selectors.js
@@ -15,6 +15,7 @@ const selectors = {
getSelectedToken,
getSelectedTokenExchangeRate,
getSelectedTokenAssetImage,
+ getAssetImages,
getTokenExchangeRate,
conversionRateSelector,
transactionsSelector,
@@ -79,6 +80,11 @@ function getSelectedTokenAssetImage (state) {
return assetImages[address]
}
+function getAssetImages (state) {
+ const assetImages = state.metamask.assetImages
+ return assetImages
+}
+
function getTokenExchangeRate (state, address) {
const contractExchangeRates = state.metamask.contractExchangeRates
return contractExchangeRates[address] || 0