fix watched tokens images showing in tx list

feature/default_network_editable
Esteban MIno 6 years ago
parent 208312b239
commit c8e5068537
  1. 3
      ui/app/components/transaction-list-item/transaction-list-item.component.js
  2. 8
      ui/app/components/transaction-list/transaction-list.component.js
  3. 3
      ui/app/components/transaction-list/transaction-list.container.js
  4. 6
      ui/app/selectors.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}

@ -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}
/>
)
}

@ -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),
}
}

@ -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

Loading…
Cancel
Save