Disable swaps whenever the environment is not development or testing, so that behaviour follows production for QA purposes (#14499)

feature/default_network_editable
Dan J Miller 3 years ago committed by ryanml
parent ce77be6402
commit 617b7828a5
  1. 6
      ui/selectors/selectors.js

@ -670,8 +670,10 @@ export function getSwapsDefaultToken(state) {
export function getIsSwapsChain(state) {
const chainId = getCurrentChainId(state);
const isProduction = process.env.METAMASK_ENVIRONMENT === 'production';
return isProduction
const isNotDevelopment =
process.env.METAMASK_ENVIRONMENT !== 'development' ||
process.env.METAMASK_ENVIRONMENT !== 'testing';
return isNotDevelopment
? ALLOWED_PROD_SWAPS_CHAIN_IDS.includes(chainId)
: ALLOWED_DEV_SWAPS_CHAIN_IDS.includes(chainId);
}

Loading…
Cancel
Save