mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix token list
This commit is contained in:
parent
bffdde2082
commit
690ddf5ed7
@ -45,7 +45,7 @@ TokenList.prototype.render = function () {
|
|||||||
const { userAddress, network } = this.props
|
const { userAddress, network } = this.props
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return this.message('Loading')
|
return this.message('Loading Tokens...')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
@ -115,22 +115,29 @@ TokenList.prototype.createFreshTokenTracker = function () {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
TokenList.prototype.componentWillUpdate = function (nextProps) {
|
TokenList.prototype.componentDidUpdate = function (nextProps) {
|
||||||
if (nextProps.network === 'loading') return
|
const {
|
||||||
const oldNet = this.props.network
|
network: oldNet,
|
||||||
const newNet = nextProps.network
|
userAddress: oldAddress,
|
||||||
|
} = this.props
|
||||||
|
const {
|
||||||
|
network: newNet,
|
||||||
|
userAddress: newAddress,
|
||||||
|
} = nextProps
|
||||||
|
|
||||||
if (oldNet && newNet && newNet !== oldNet) {
|
if (newNet === 'loading') return
|
||||||
this.setState({ isLoading: true })
|
if (!oldNet || !newNet || !oldAddress || !newAddress) return
|
||||||
this.createFreshTokenTracker()
|
if (oldAddress === newAddress && oldNet === newNet) return
|
||||||
}
|
|
||||||
|
this.setState({ isLoading: true })
|
||||||
|
this.createFreshTokenTracker()
|
||||||
}
|
}
|
||||||
|
|
||||||
TokenList.prototype.updateBalances = function (tokens) {
|
TokenList.prototype.updateBalances = function (tokens) {
|
||||||
// const heldTokens = tokens.filter(token => {
|
const heldTokens = tokens.filter(token => {
|
||||||
// return token.balance !== '0' && token.string !== '0.000'
|
return token.balance !== '0' && token.string !== '0.000'
|
||||||
// })
|
})
|
||||||
this.setState({ tokens: tokens, isLoading: false })
|
this.setState({ tokens: heldTokens, isLoading: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
TokenList.prototype.componentWillUnmount = function () {
|
TokenList.prototype.componentWillUnmount = function () {
|
||||||
|
@ -65,12 +65,14 @@ TxList.prototype.renderTransactionListItem = function (transaction) {
|
|||||||
transactionAmount: formatBalance(transaction.txParams.value, 6),
|
transactionAmount: formatBalance(transaction.txParams.value, 6),
|
||||||
}
|
}
|
||||||
const {
|
const {
|
||||||
address = '',
|
address,
|
||||||
transactionStatus,
|
transactionStatus,
|
||||||
transactionAmount,
|
transactionAmount,
|
||||||
dateString,
|
dateString,
|
||||||
} = props
|
} = props
|
||||||
|
|
||||||
|
if (!address) return null
|
||||||
|
|
||||||
return h('div', {
|
return h('div', {
|
||||||
key: transaction.id,
|
key: transaction.id,
|
||||||
}, [
|
}, [
|
||||||
|
Loading…
Reference in New Issue
Block a user