mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-30 08:09:15 +01:00
73 lines
2.1 KiB
JavaScript
73 lines
2.1 KiB
JavaScript
import { compose } from 'redux';
|
|
import { connect } from 'react-redux';
|
|
import { withRouter } from 'react-router-dom';
|
|
import {
|
|
setFeatureFlag,
|
|
setParticipateInMetaMetrics,
|
|
setUsePhishDetect,
|
|
setUseTokenDetection,
|
|
setIpfsGateway,
|
|
setUseMultiAccountBalanceChecker,
|
|
setUseCurrencyRateCheck,
|
|
setUseNftDetection,
|
|
setOpenSeaEnabled,
|
|
} from '../../../store/actions';
|
|
import { getOpenSeaEnabled, getUseNftDetection } from '../../../selectors';
|
|
import SecurityTab from './security-tab.component';
|
|
|
|
const mapStateToProps = (state) => {
|
|
const {
|
|
appState: { warning },
|
|
metamask,
|
|
} = state;
|
|
const {
|
|
featureFlags: { showIncomingTransactions } = {},
|
|
participateInMetaMetrics,
|
|
usePhishDetect,
|
|
useTokenDetection,
|
|
ipfsGateway,
|
|
useMultiAccountBalanceChecker,
|
|
useCurrencyRateCheck,
|
|
} = metamask;
|
|
|
|
return {
|
|
warning,
|
|
showIncomingTransactions,
|
|
participateInMetaMetrics,
|
|
usePhishDetect,
|
|
useTokenDetection,
|
|
ipfsGateway,
|
|
useMultiAccountBalanceChecker,
|
|
useCurrencyRateCheck,
|
|
useNftDetection: getUseNftDetection(state),
|
|
openSeaEnabled: getOpenSeaEnabled(state),
|
|
};
|
|
};
|
|
|
|
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));
|
|
},
|
|
setUseNftDetection: (val) => dispatch(setUseNftDetection(val)),
|
|
setOpenSeaEnabled: (val) => dispatch(setOpenSeaEnabled(val)),
|
|
};
|
|
};
|
|
|
|
export default compose(
|
|
withRouter,
|
|
connect(mapStateToProps, mapDispatchToProps),
|
|
)(SecurityTab);
|