aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVimal <vtiwari@coinswitch.co>2019-02-28 22:20:48 +0800
committerVimal <vtiwari@coinswitch.co>2019-02-28 22:20:48 +0800
commitab5fe4d65994ce66ed6b796197eda349fbe5d145 (patch)
treeeb9727c15c13f8afdd4aca8ecfd70dc7b602d8ee
parent6bb92a8672edf23465fb109c8966d2e56500ea86 (diff)
downloadtangerine-wallet-browser-ab5fe4d65994ce66ed6b796197eda349fbe5d145.tar
tangerine-wallet-browser-ab5fe4d65994ce66ed6b796197eda349fbe5d145.tar.gz
tangerine-wallet-browser-ab5fe4d65994ce66ed6b796197eda349fbe5d145.tar.bz2
tangerine-wallet-browser-ab5fe4d65994ce66ed6b796197eda349fbe5d145.tar.lz
tangerine-wallet-browser-ab5fe4d65994ce66ed6b796197eda349fbe5d145.tar.xz
tangerine-wallet-browser-ab5fe4d65994ce66ed6b796197eda349fbe5d145.tar.zst
tangerine-wallet-browser-ab5fe4d65994ce66ed6b796197eda349fbe5d145.zip
PR 5575 review comment fixes
-rw-r--r--app/scripts/lib/buy-eth-url.js47
-rw-r--r--ui/app/components/modals/deposit-ether-modal.js2
2 files changed, 25 insertions, 24 deletions
diff --git a/app/scripts/lib/buy-eth-url.js b/app/scripts/lib/buy-eth-url.js
index 4b1572959..d434473ee 100644
--- a/app/scripts/lib/buy-eth-url.js
+++ b/app/scripts/lib/buy-eth-url.js
@@ -11,28 +11,29 @@ module.exports = getBuyEthUrl
* network does not match any of the specified cases, or if no network is given, returns undefined.
*
*/
-function getBuyEthUrl ({ network, amount, address }) {
- let url
- switch (network) {
- case '1':
- url = `https://buy.coinbase.com/?code=9ec56d01-7e81-5017-930c-513daa27bb6a&amount=${amount}&address=${address}&crypto_currency=ETH`
- break
-
- case '3':
- url = 'https://faucet.metamask.io/'
- break
-
- case '4':
- url = 'https://www.rinkeby.io/'
- break
-
- case '42':
- url = 'https://github.com/kovan-testnet/faucet'
- break
-
- case '5':
- url = `https://metamask.coinswitch.co/?address=${address}&to=eth`
- break
+function getBuyEthUrl({ network, amount, address, service }) {
+ let url
+ if (typeof network !== 'undefined') {
+ switch (network) {
+ case '1':
+ url = `https://buy.coinbase.com/?code=9ec56d01-7e81-5017-930c-513daa27bb6a&amount=${amount}&address=${address}&crypto_currency=ETH`
+ break
+ case '3':
+ url = 'https://faucet.metamask.io/'
+ break
+ case '4':
+ url = 'https://www.rinkeby.io/'
+ break
+ case '42':
+ url = 'https://github.com/kovan-testnet/faucet'
+ break
+ }
+ } else {
+ switch (service) {
+ case 'coinswitch':
+ url = `https://metamask.coinswitch.co/?address=${address}&to=eth`
+ break
+ }
}
- return url
+ return url
}
diff --git a/ui/app/components/modals/deposit-ether-modal.js b/ui/app/components/modals/deposit-ether-modal.js
index 6686eaefa..3f74dc065 100644
--- a/ui/app/components/modals/deposit-ether-modal.js
+++ b/ui/app/components/modals/deposit-ether-modal.js
@@ -32,7 +32,7 @@ function mapDispatchToProps (dispatch) {
dispatch(actions.buyEth({ network: '1', address, amount: 0 }))
},
toCoinSwitch: (address) => {
- dispatch(actions.buyEth({ network: '5', address, amount: 0 }))
+ dispatch(actions.buyEth({ service: 'coinswitch', address, amount: 0 }))
},
hideModal: () => {
dispatch(actions.hideModal())