1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

PR 5575 review comment fixes

This commit is contained in:
Vimal 2019-02-28 19:50:48 +05:30
parent 6bb92a8672
commit ab5fe4d659
2 changed files with 25 additions and 24 deletions

View File

@ -11,28 +11,29 @@ module.exports = getBuyEthUrl
* network does not match any of the specified cases, or if no network is given, returns undefined. * network does not match any of the specified cases, or if no network is given, returns undefined.
* *
*/ */
function getBuyEthUrl ({ network, amount, address }) { function getBuyEthUrl({ network, amount, address, service }) {
let url let url
switch (network) { if (typeof network !== 'undefined') {
case '1': switch (network) {
url = `https://buy.coinbase.com/?code=9ec56d01-7e81-5017-930c-513daa27bb6a&amount=${amount}&address=${address}&crypto_currency=ETH` case '1':
break url = `https://buy.coinbase.com/?code=9ec56d01-7e81-5017-930c-513daa27bb6a&amount=${amount}&address=${address}&crypto_currency=ETH`
break
case '3': case '3':
url = 'https://faucet.metamask.io/' url = 'https://faucet.metamask.io/'
break break
case '4':
case '4': url = 'https://www.rinkeby.io/'
url = 'https://www.rinkeby.io/' break
break case '42':
url = 'https://github.com/kovan-testnet/faucet'
case '42': break
url = 'https://github.com/kovan-testnet/faucet' }
break } else {
switch (service) {
case '5': case 'coinswitch':
url = `https://metamask.coinswitch.co/?address=${address}&to=eth` url = `https://metamask.coinswitch.co/?address=${address}&to=eth`
break break
}
} }
return url return url
} }

View File

@ -32,7 +32,7 @@ function mapDispatchToProps (dispatch) {
dispatch(actions.buyEth({ network: '1', address, amount: 0 })) dispatch(actions.buyEth({ network: '1', address, amount: 0 }))
}, },
toCoinSwitch: (address) => { toCoinSwitch: (address) => {
dispatch(actions.buyEth({ network: '5', address, amount: 0 })) dispatch(actions.buyEth({ service: 'coinswitch', address, amount: 0 }))
}, },
hideModal: () => { hideModal: () => {
dispatch(actions.hideModal()) dispatch(actions.hideModal())