1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +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 GitHub
parent f947e5721a
commit b1df04c253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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