1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-30 08:09:15 +01:00
metamask-extension/ui/pages/settings/security-tab/security-tab.container.js

66 lines
1.7 KiB
JavaScript
Raw Normal View History

import { compose } from 'redux';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import {
setFeatureFlag,
setParticipateInMetaMetrics,
setUsePhishDetect,
setUseTokenDetection,
setIpfsGateway,
setUseMultiAccountBalanceChecker,
setUseCurrencyRateCheck,
} from '../../../store/actions';
import SecurityTab from './security-tab.component';
2020-02-15 21:34:12 +01:00
const mapStateToProps = (state) => {
const {
2020-11-03 00:41:28 +01:00
appState: { warning },
metamask,
} = state;
2020-11-03 00:41:28 +01:00
const {
featureFlags: { showIncomingTransactions } = {},
participateInMetaMetrics,
usePhishDetect,
useTokenDetection,
ipfsGateway,
useMultiAccountBalanceChecker,
useCurrencyRateCheck,
} = metamask;
return {
warning,
showIncomingTransactions,
participateInMetaMetrics,
usePhishDetect,
useTokenDetection,
ipfsGateway,
useMultiAccountBalanceChecker,
useCurrencyRateCheck,
};
};
2020-02-15 21:34:12 +01:00
const mapDispatchToProps = (dispatch) => {
return {
2020-11-03 00:41:28 +01:00
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));
},
};
};
export default compose(
withRouter,
connect(mapStateToProps, mapDispatchToProps),
)(SecurityTab);