1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00

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

This commit is contained in:
Dan J Miller 2022-04-21 13:49:34 -02:30 committed by ryanml
parent ce77be6402
commit 617b7828a5

View File

@ -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);
}