mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-30 08:09:15 +01:00
69 lines
1.9 KiB
JavaScript
69 lines
1.9 KiB
JavaScript
import { compose } from 'redux';
|
|
import { connect } from 'react-redux';
|
|
import { withRouter } from 'react-router-dom';
|
|
import {
|
|
setFeatureFlag,
|
|
setParticipateInMetaMetrics,
|
|
setUsePhishDetect,
|
|
setUseTokenDetection,
|
|
setIpfsGateway,
|
|
setUseMultiAccountBalanceChecker,
|
|
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,
|
|
} = metamask;
|
|
|
|
return {
|
|
warning,
|
|
showIncomingTransactions,
|
|
participateInMetaMetrics,
|
|
usePhishDetect,
|
|
useTokenDetection,
|
|
ipfsGateway,
|
|
useMultiAccountBalanceChecker,
|
|
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)),
|
|
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);
|