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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const { setPendingTokens/* , history*/ } = this.props
|
const { setPendingTokens, network/* , history*/ } = this.props
|
||||||
const {
|
const {
|
||||||
customAddress: address,
|
customAddress: address,
|
||||||
customSymbol: symbol,
|
customSymbol: symbol,
|
||||||
|
@ -429,6 +429,7 @@ class AddTokenScreen extends Component {
|
||||||
address,
|
address,
|
||||||
symbol,
|
symbol,
|
||||||
decimals,
|
decimals,
|
||||||
|
network: network,
|
||||||
}
|
}
|
||||||
|
|
||||||
setPendingTokens({ customToken, selectedTokens })
|
setPendingTokens({ customToken, selectedTokens })
|
||||||
|
|
|
@ -2296,9 +2296,12 @@ function updateNetworkEndpointType (networkEndpointType) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setPendingTokens (pendingTokens) {
|
function setPendingTokens (pendingTokens) {
|
||||||
const { customToken = {}, selectedTokens = {} } = pendingTokens
|
const { selectedTokens = {}, customToken = {} } = pendingTokens
|
||||||
const { address, symbol, decimals } = customToken
|
const { address, symbol, decimals, network } = customToken
|
||||||
const tokens = address && symbol && decimals
|
Object.keys(selectedTokens).forEach(address => {
|
||||||
|
selectedTokens[address].network = parseInt(network)
|
||||||
|
})
|
||||||
|
const tokens = address && symbol && decimals && network
|
||||||
? { ...selectedTokens, [address]: { ...customToken, isCustom: true } }
|
? { ...selectedTokens, [address]: { ...customToken, isCustom: true } }
|
||||||
: selectedTokens
|
: selectedTokens
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ export default class ConfirmAddToken extends Component {
|
||||||
</div>
|
</div>
|
||||||
<div className="confirm-add-token__token-list">
|
<div className="confirm-add-token__token-list">
|
||||||
{
|
{
|
||||||
Object.entries(pendingTokens)
|
pendingTokens && Object.entries(pendingTokens)
|
||||||
.map(([ address, token ]) => {
|
.map(([ address, token ]) => {
|
||||||
const { name, symbol } = token
|
const { name, symbol } = token
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue