aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/ducks/gas
diff options
context:
space:
mode:
authorDan J Miller <danjm.com@gmail.com>2019-03-22 22:50:12 +0800
committerGitHub <noreply@github.com>2019-03-22 22:50:12 +0800
commit468bc96bdfc08e80119b3d5b3a54a3cf84046af8 (patch)
treeb832d0e741e406eed2fa8c7a80e520740257d761 /ui/app/ducks/gas
parent31175625b446cb5d18b17db23018bca8b14d280c (diff)
downloadtangerine-wallet-browser-468bc96bdfc08e80119b3d5b3a54a3cf84046af8.tar.gz
tangerine-wallet-browser-468bc96bdfc08e80119b3d5b3a54a3cf84046af8.tar.zst
tangerine-wallet-browser-468bc96bdfc08e80119b3d5b3a54a3cf84046af8.zip
Hide gas price chart and prevent api call when not on ethereum networks. (#6300)
Add missing translations in gas customization modal
Diffstat (limited to 'ui/app/ducks/gas')
-rw-r--r--ui/app/ducks/gas/gas-duck.test.js12
-rw-r--r--ui/app/ducks/gas/gas.duck.js11
2 files changed, 19 insertions, 4 deletions
diff --git a/ui/app/ducks/gas/gas-duck.test.js b/ui/app/ducks/gas/gas-duck.test.js
index 4e875e020..c0152c74f 100644
--- a/ui/app/ducks/gas/gas-duck.test.js
+++ b/ui/app/ducks/gas/gas-duck.test.js
@@ -364,7 +364,9 @@ describe('Gas Duck', () => {
{},
initState,
{ basicPriceAndTimeEstimatesLastRetrieved: 1000000 }
- ) }))
+ ),
+ metamask: { provider: { type: 'ropsten' } },
+ }))
assert.deepEqual(
mockDistpatch.getCall(0).args,
[{ type: BASIC_GAS_ESTIMATE_LOADING_STARTED} ]
@@ -428,7 +430,9 @@ describe('Gas Duck', () => {
{},
initState,
{ priceAndTimeEstimatesLastRetrieved: 1000000 }
- ) }))
+ ),
+ metamask: { provider: { type: 'ropsten' } },
+ }))
assert.deepEqual(
mockDistpatch.getCall(0).args,
[{ type: GAS_ESTIMATE_LOADING_STARTED} ]
@@ -479,7 +483,9 @@ describe('Gas Duck', () => {
gasprice: 50,
}],
}
- ) }))
+ ),
+ metamask: { provider: { type: 'ropsten' } },
+ }))
assert.deepEqual(
mockDistpatch.getCall(0).args,
[{ type: GAS_ESTIMATE_LOADING_STARTED} ]
diff --git a/ui/app/ducks/gas/gas.duck.js b/ui/app/ducks/gas/gas.duck.js
index 0a571a78e..8eb68f846 100644
--- a/ui/app/ducks/gas/gas.duck.js
+++ b/ui/app/ducks/gas/gas.duck.js
@@ -7,6 +7,9 @@ import {
import {
decGWEIToHexWEI,
} from '../../helpers/utils/conversions.util'
+import {
+ isEthereumNetwork,
+} from '../../selectors/selectors'
// Actions
const BASIC_GAS_ESTIMATE_LOADING_FINISHED = 'metamask/gas/BASIC_GAS_ESTIMATE_LOADING_FINISHED'
@@ -356,10 +359,16 @@ function inliersByIQR (data, prop) {
export function fetchGasEstimates (blockTime) {
return (dispatch, getState) => {
+ const state = getState()
+
+ if (isEthereumNetwork(state)) {
+ return Promise.resolve(null)
+ }
+
const {
priceAndTimeEstimatesLastRetrieved,
priceAndTimeEstimates,
- } = getState().gas
+ } = state.gas
const timeLastRetrieved = priceAndTimeEstimatesLastRetrieved || loadLocalStorageData('GAS_API_ESTIMATES_LAST_RETRIEVED') || 0
dispatch(gasEstimatesLoadingStarted())