mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 10:30:04 +01:00
a8c1756816
* Remove 3box feature and delete ThreeBoxController Lint locale messages lavamoat policy updates * Restore 3Box user trait with value `false` The 3Box user trait has been restored and hard-coded as `false`. This ensures that users don't get stuck in our metrics as having this trait. A deprecation comment has been left in various places for this trait. * Remove unused state * Remove additional 3box-related things * Run `yarn-deduplicate` * Restore migration that was lost while rebasing * Remove obsolete override * Remove additional unused resolutions/dependencies * Update LavaMoat policies * Remove obsolete security advisory ignore entries * Remove 3Box fixture builder method * Update unit tests Co-authored-by: Mark Stacey <markjstacey@gmail.com>
100 lines
2.8 KiB
JavaScript
100 lines
2.8 KiB
JavaScript
import { compose } from 'redux';
|
|
import { connect } from 'react-redux';
|
|
import { withRouter } from 'react-router-dom';
|
|
import {
|
|
displayWarning,
|
|
setFeatureFlag,
|
|
showModal,
|
|
setShowFiatConversionOnTestnetsPreference,
|
|
setShowTestNetworks,
|
|
setAutoLockTimeLimit,
|
|
setUseNonceField,
|
|
setIpfsGateway,
|
|
setLedgerTransportPreference,
|
|
setDismissSeedBackUpReminder,
|
|
setUseTokenDetection,
|
|
backupUserData,
|
|
restoreUserData,
|
|
} from '../../../store/actions';
|
|
import { getPreferences } from '../../../selectors';
|
|
import { doesUserHaveALedgerAccount } from '../../../ducks/metamask/metamask';
|
|
import AdvancedTab from './advanced-tab.component';
|
|
|
|
export const mapStateToProps = (state) => {
|
|
const {
|
|
appState: { warning },
|
|
metamask,
|
|
} = state;
|
|
const {
|
|
featureFlags: { sendHexData, advancedInlineGas } = {},
|
|
useNonceField,
|
|
ipfsGateway,
|
|
ledgerTransportType,
|
|
dismissSeedBackUpReminder,
|
|
useTokenDetection,
|
|
} = metamask;
|
|
const {
|
|
showFiatInTestnets,
|
|
showTestNetworks,
|
|
autoLockTimeLimit = 0,
|
|
} = getPreferences(state);
|
|
|
|
const userHasALedgerAccount = doesUserHaveALedgerAccount(state);
|
|
|
|
return {
|
|
warning,
|
|
sendHexData,
|
|
advancedInlineGas,
|
|
showFiatInTestnets,
|
|
showTestNetworks,
|
|
autoLockTimeLimit,
|
|
useNonceField,
|
|
ipfsGateway,
|
|
ledgerTransportType,
|
|
dismissSeedBackUpReminder,
|
|
userHasALedgerAccount,
|
|
useTokenDetection,
|
|
};
|
|
};
|
|
|
|
export const mapDispatchToProps = (dispatch) => {
|
|
return {
|
|
backupUserData: () => backupUserData(),
|
|
restoreUserData: (jsonString) => restoreUserData(jsonString),
|
|
setHexDataFeatureFlag: (shouldShow) =>
|
|
dispatch(setFeatureFlag('sendHexData', shouldShow)),
|
|
displayWarning: (warning) => dispatch(displayWarning(warning)),
|
|
showResetAccountConfirmationModal: () =>
|
|
dispatch(showModal({ name: 'CONFIRM_RESET_ACCOUNT' })),
|
|
setAdvancedInlineGasFeatureFlag: (shouldShow) =>
|
|
dispatch(setFeatureFlag('advancedInlineGas', shouldShow)),
|
|
setUseNonceField: (value) => dispatch(setUseNonceField(value)),
|
|
setShowFiatConversionOnTestnetsPreference: (value) => {
|
|
return dispatch(setShowFiatConversionOnTestnetsPreference(value));
|
|
},
|
|
setShowTestNetworks: (value) => {
|
|
return dispatch(setShowTestNetworks(value));
|
|
},
|
|
setAutoLockTimeLimit: (value) => {
|
|
return dispatch(setAutoLockTimeLimit(value));
|
|
},
|
|
setIpfsGateway: (value) => {
|
|
return dispatch(setIpfsGateway(value));
|
|
},
|
|
setLedgerTransportPreference: (value) => {
|
|
return dispatch(setLedgerTransportPreference(value));
|
|
},
|
|
setDismissSeedBackUpReminder: (value) => {
|
|
return dispatch(setDismissSeedBackUpReminder(value));
|
|
},
|
|
setUseTokenDetection: (value) => {
|
|
return dispatch(setUseTokenDetection(value));
|
|
},
|
|
};
|
|
};
|
|
|
|
export default compose(
|
|
withRouter,
|
|
connect(mapStateToProps, mapDispatchToProps),
|
|
)(AdvancedTab);
|