mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-02 06:07:06 +01:00
99c709ff8f
* Allow user to turn off IPFS gateway resolution * Add end to end test for toggle on and off * Fix jest tests and snapshots * Change variable name * Implement provided content * Use MetaMask eth instead * Allow searching for ENS setting * Fix jest --------- Co-authored-by: Brad Decker <bhdecker84@gmail.com>
71 lines
1.9 KiB
JavaScript
71 lines
1.9 KiB
JavaScript
import { connect } from 'react-redux';
|
|
import { withRouter } from 'react-router-dom';
|
|
import { compose } from 'redux';
|
|
import {
|
|
setFeatureFlag,
|
|
setIpfsGateway,
|
|
setParticipateInMetaMetrics,
|
|
setUseCurrencyRateCheck,
|
|
setUseMultiAccountBalanceChecker,
|
|
setUsePhishDetect,
|
|
setUseTokenDetection,
|
|
setUseAddressBarEnsResolution,
|
|
} from '../../../store/actions';
|
|
import SecurityTab from './security-tab.component';
|
|
|
|
const mapStateToProps = (state) => {
|
|
const {
|
|
appState: { warning },
|
|
metamask,
|
|
} = state;
|
|
const {
|
|
featureFlags: { showIncomingTransactions } = {},
|
|
participateInMetaMetrics,
|
|
usePhishDetect,
|
|
useTokenDetection,
|
|
ipfsGateway,
|
|
useMultiAccountBalanceChecker,
|
|
useCurrencyRateCheck,
|
|
useAddressBarEnsResolution,
|
|
} = metamask;
|
|
|
|
return {
|
|
warning,
|
|
showIncomingTransactions,
|
|
participateInMetaMetrics,
|
|
usePhishDetect,
|
|
useTokenDetection,
|
|
ipfsGateway,
|
|
useMultiAccountBalanceChecker,
|
|
useCurrencyRateCheck,
|
|
useAddressBarEnsResolution,
|
|
};
|
|
};
|
|
|
|
const mapDispatchToProps = (dispatch) => {
|
|
return {
|
|
setParticipateInMetaMetrics: (val) =>
|
|
dispatch(setParticipateInMetaMetrics(val)),
|
|
setShowIncomingTransactionsFeatureFlag: (shouldShow) =>
|
|
dispatch(setFeatureFlag('showIncomingTransactions', shouldShow)),
|
|
setUsePhishDetect: (val) => dispatch(setUsePhishDetect(val)),
|
|
setUseCurrencyRateCheck: (val) => dispatch(setUseCurrencyRateCheck(val)),
|
|
setUseTokenDetection: (value) => {
|
|
return dispatch(setUseTokenDetection(value));
|
|
},
|
|
setIpfsGateway: (value) => {
|
|
return dispatch(setIpfsGateway(value));
|
|
},
|
|
setUseMultiAccountBalanceChecker: (value) => {
|
|
return dispatch(setUseMultiAccountBalanceChecker(value));
|
|
},
|
|
setUseAddressBarEnsResolution: (value) =>
|
|
dispatch(setUseAddressBarEnsResolution(value)),
|
|
};
|
|
};
|
|
|
|
export default compose(
|
|
withRouter,
|
|
connect(mapStateToProps, mapDispatchToProps),
|
|
)(SecurityTab);
|