You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.4 KiB
83 lines
2.4 KiB
4 years ago
|
import { compose } from 'redux';
|
||
|
import { connect } from 'react-redux';
|
||
|
import { withRouter } from 'react-router-dom';
|
||
6 years ago
|
import {
|
||
|
displayWarning,
|
||
|
setFeatureFlag,
|
||
|
showModal,
|
||
|
setShowFiatConversionOnTestnetsPreference,
|
||
5 years ago
|
setAutoLockTimeLimit,
|
||
5 years ago
|
setThreeBoxSyncingPermission,
|
||
5 years ago
|
turnThreeBoxSyncingOnAndInitialize,
|
||
5 years ago
|
setUseNonceField,
|
||
5 years ago
|
setIpfsGateway,
|
||
4 years ago
|
setLedgerLivePreference,
|
||
4 years ago
|
} from '../../../store/actions';
|
||
|
import { getPreferences } from '../../../selectors';
|
||
|
import AdvancedTab from './advanced-tab.component';
|
||
6 years ago
|
|
||
5 years ago
|
export const mapStateToProps = (state) => {
|
||
6 years ago
|
const {
|
||
4 years ago
|
appState: { warning },
|
||
|
metamask,
|
||
4 years ago
|
} = state;
|
||
4 years ago
|
const {
|
||
4 years ago
|
featureFlags: { sendHexData, advancedInlineGas } = {},
|
||
5 years ago
|
threeBoxSyncingAllowed,
|
||
|
threeBoxDisabled,
|
||
5 years ago
|
useNonceField,
|
||
5 years ago
|
ipfsGateway,
|
||
4 years ago
|
useLedgerLive,
|
||
4 years ago
|
} = metamask;
|
||
|
const { showFiatInTestnets, autoLockTimeLimit } = getPreferences(state);
|
||
6 years ago
|
|
||
|
return {
|
||
|
warning,
|
||
|
sendHexData,
|
||
|
advancedInlineGas,
|
||
|
showFiatInTestnets,
|
||
5 years ago
|
autoLockTimeLimit,
|
||
5 years ago
|
threeBoxSyncingAllowed,
|
||
|
threeBoxDisabled,
|
||
5 years ago
|
useNonceField,
|
||
5 years ago
|
ipfsGateway,
|
||
4 years ago
|
useLedgerLive,
|
||
4 years ago
|
};
|
||
|
};
|
||
6 years ago
|
|
||
5 years ago
|
export const mapDispatchToProps = (dispatch) => {
|
||
6 years ago
|
return {
|
||
4 years ago
|
setHexDataFeatureFlag: (shouldShow) =>
|
||
|
dispatch(setFeatureFlag('sendHexData', shouldShow)),
|
||
5 years ago
|
displayWarning: (warning) => dispatch(displayWarning(warning)),
|
||
4 years ago
|
showResetAccountConfirmationModal: () =>
|
||
|
dispatch(showModal({ name: 'CONFIRM_RESET_ACCOUNT' })),
|
||
|
setAdvancedInlineGasFeatureFlag: (shouldShow) =>
|
||
|
dispatch(setFeatureFlag('advancedInlineGas', shouldShow)),
|
||
5 years ago
|
setUseNonceField: (value) => dispatch(setUseNonceField(value)),
|
||
|
setShowFiatConversionOnTestnetsPreference: (value) => {
|
||
4 years ago
|
return dispatch(setShowFiatConversionOnTestnetsPreference(value));
|
||
6 years ago
|
},
|
||
5 years ago
|
setAutoLockTimeLimit: (value) => {
|
||
4 years ago
|
return dispatch(setAutoLockTimeLimit(value));
|
||
6 years ago
|
},
|
||
5 years ago
|
setThreeBoxSyncingPermission: (newThreeBoxSyncingState) => {
|
||
5 years ago
|
if (newThreeBoxSyncingState) {
|
||
4 years ago
|
dispatch(turnThreeBoxSyncingOnAndInitialize());
|
||
5 years ago
|
} else {
|
||
4 years ago
|
dispatch(setThreeBoxSyncingPermission(newThreeBoxSyncingState));
|
||
5 years ago
|
}
|
||
|
},
|
||
5 years ago
|
setIpfsGateway: (value) => {
|
||
4 years ago
|
return dispatch(setIpfsGateway(value));
|
||
5 years ago
|
},
|
||
4 years ago
|
setLedgerLivePreference: (value) =>
|
||
|
dispatch(setLedgerLivePreference(value)),
|
||
4 years ago
|
};
|
||
|
};
|
||
6 years ago
|
|
||
|
export default compose(
|
||
|
withRouter,
|
||
4 years ago
|
connect(mapStateToProps, mapDispatchToProps),
|
||
4 years ago
|
)(AdvancedTab);
|