tokens added from search should be visible only for the network where search was made
This commit is contained in:
parent
c01e907677
commit
d50d957fa3
|
@ -417,7 +417,7 @@ class AddTokenScreen extends Component {
|
|||
return
|
||||
}
|
||||
|
||||
const { setPendingTokens/* , history*/ } = this.props
|
||||
const { setPendingTokens, network/* , history*/ } = this.props
|
||||
const {
|
||||
customAddress: address,
|
||||
customSymbol: symbol,
|
||||
|
@ -429,6 +429,7 @@ class AddTokenScreen extends Component {
|
|||
address,
|
||||
symbol,
|
||||
decimals,
|
||||
network: network,
|
||||
}
|
||||
|
||||
setPendingTokens({ customToken, selectedTokens })
|
||||
|
|
|
@ -2296,9 +2296,12 @@ function updateNetworkEndpointType (networkEndpointType) {
|
|||
}
|
||||
|
||||
function setPendingTokens (pendingTokens) {
|
||||
const { customToken = {}, selectedTokens = {} } = pendingTokens
|
||||
const { address, symbol, decimals } = customToken
|
||||
const tokens = address && symbol && decimals
|
||||
const { selectedTokens = {}, customToken = {} } = pendingTokens
|
||||
const { address, symbol, decimals, network } = customToken
|
||||
Object.keys(selectedTokens).forEach(address => {
|
||||
selectedTokens[address].network = parseInt(network)
|
||||
})
|
||||
const tokens = address && symbol && decimals && network
|
||||
? { ...selectedTokens, [address]: { ...customToken, isCustom: true } }
|
||||
: selectedTokens
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ export default class ConfirmAddToken extends Component {
|
|||
</div>
|
||||
<div className="confirm-add-token__token-list">
|
||||
{
|
||||
Object.entries(pendingTokens)
|
||||
pendingTokens && Object.entries(pendingTokens)
|
||||
.map(([ address, token ]) => {
|
||||
const { name, symbol } = token
|
||||
|
||||
|
|
Loading…
Reference in New Issue