mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Remove unused props from routes and network dropdown (#6919)
These props were discovered to be unused while I was working on #6680
This commit is contained in:
parent
1f45798707
commit
329c376449
@ -32,9 +32,6 @@ function mapStateToProps (state) {
|
|||||||
|
|
||||||
function mapDispatchToProps (dispatch) {
|
function mapDispatchToProps (dispatch) {
|
||||||
return {
|
return {
|
||||||
hideModal: () => {
|
|
||||||
dispatch(actions.hideModal())
|
|
||||||
},
|
|
||||||
setProviderType: (type) => {
|
setProviderType: (type) => {
|
||||||
dispatch(actions.setProviderType(type))
|
dispatch(actions.setProviderType(type))
|
||||||
},
|
},
|
||||||
@ -47,7 +44,6 @@ function mapDispatchToProps (dispatch) {
|
|||||||
delRpcTarget: (target) => {
|
delRpcTarget: (target) => {
|
||||||
dispatch(actions.delRpcTarget(target))
|
dispatch(actions.delRpcTarget(target))
|
||||||
},
|
},
|
||||||
showNetworkDropdown: () => dispatch(actions.showNetworkDropdown()),
|
|
||||||
hideNetworkDropdown: () => dispatch(actions.hideNetworkDropdown()),
|
hideNetworkDropdown: () => dispatch(actions.hideNetworkDropdown()),
|
||||||
setNetworksTabAddMode: isInAddMode => dispatch(actions.setNetworksTabAddMode(isInAddMode)),
|
setNetworksTabAddMode: isInAddMode => dispatch(actions.setNetworksTabAddMode(isInAddMode)),
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import { compose } from 'recompose'
|
|||||||
import actions from '../../store/actions'
|
import actions from '../../store/actions'
|
||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
import IdleTimer from 'react-idle-timer'
|
import IdleTimer from 'react-idle-timer'
|
||||||
import {getMetaMaskAccounts, getNetworkIdentifier, preferencesSelector} from '../../selectors/selectors'
|
import {getNetworkIdentifier, preferencesSelector} from '../../selectors/selectors'
|
||||||
import classnames from 'classnames'
|
import classnames from 'classnames'
|
||||||
|
|
||||||
// init
|
// init
|
||||||
@ -259,7 +259,7 @@ class Routes extends Component {
|
|||||||
passwordBox.focus()
|
passwordBox.focus()
|
||||||
} else {
|
} else {
|
||||||
// currently active: deactivate
|
// currently active: deactivate
|
||||||
this.props.dispatch(actions.lockMetamask(false))
|
this.props.lockMetaMask()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,31 +330,14 @@ Routes.propTypes = {
|
|||||||
sidebar: PropTypes.object,
|
sidebar: PropTypes.object,
|
||||||
alertOpen: PropTypes.bool,
|
alertOpen: PropTypes.bool,
|
||||||
hideSidebar: PropTypes.func,
|
hideSidebar: PropTypes.func,
|
||||||
isOnboarding: PropTypes.bool,
|
|
||||||
isUnlocked: PropTypes.bool,
|
isUnlocked: PropTypes.bool,
|
||||||
networkDropdownOpen: PropTypes.bool,
|
|
||||||
showNetworkDropdown: PropTypes.func,
|
|
||||||
hideNetworkDropdown: PropTypes.func,
|
|
||||||
setLastActiveTime: PropTypes.func,
|
setLastActiveTime: PropTypes.func,
|
||||||
history: PropTypes.object,
|
history: PropTypes.object,
|
||||||
location: PropTypes.object,
|
location: PropTypes.object,
|
||||||
dispatch: PropTypes.func,
|
lockMetaMask: PropTypes.func,
|
||||||
toggleAccountMenu: PropTypes.func,
|
|
||||||
selectedAddress: PropTypes.string,
|
|
||||||
lostAccounts: PropTypes.array,
|
|
||||||
isInitialized: PropTypes.bool,
|
|
||||||
forgottenPassword: PropTypes.bool,
|
|
||||||
activeAddress: PropTypes.string,
|
|
||||||
unapprovedTxs: PropTypes.object,
|
|
||||||
submittedPendingTransactions: PropTypes.array,
|
submittedPendingTransactions: PropTypes.array,
|
||||||
unapprovedMsgCount: PropTypes.number,
|
|
||||||
unapprovedPersonalMsgCount: PropTypes.number,
|
|
||||||
unapprovedTypedMessagesCount: PropTypes.number,
|
|
||||||
welcomeScreenSeen: PropTypes.bool,
|
|
||||||
isPopup: PropTypes.bool,
|
|
||||||
isMouseUser: PropTypes.bool,
|
isMouseUser: PropTypes.bool,
|
||||||
setMouseUserState: PropTypes.func,
|
setMouseUserState: PropTypes.func,
|
||||||
t: PropTypes.func,
|
|
||||||
providerId: PropTypes.string,
|
providerId: PropTypes.string,
|
||||||
providerRequests: PropTypes.array,
|
providerRequests: PropTypes.array,
|
||||||
autoLogoutTimeLimit: PropTypes.number,
|
autoLogoutTimeLimit: PropTypes.number,
|
||||||
@ -363,7 +346,6 @@ Routes.propTypes = {
|
|||||||
function mapStateToProps (state) {
|
function mapStateToProps (state) {
|
||||||
const { appState, metamask } = state
|
const { appState, metamask } = state
|
||||||
const {
|
const {
|
||||||
networkDropdownOpen,
|
|
||||||
sidebar,
|
sidebar,
|
||||||
alertOpen,
|
alertOpen,
|
||||||
alertMessage,
|
alertMessage,
|
||||||
@ -371,74 +353,34 @@ function mapStateToProps (state) {
|
|||||||
loadingMessage,
|
loadingMessage,
|
||||||
} = appState
|
} = appState
|
||||||
|
|
||||||
const accounts = getMetaMaskAccounts(state)
|
|
||||||
const { autoLogoutTimeLimit = 0 } = preferencesSelector(state)
|
const { autoLogoutTimeLimit = 0 } = preferencesSelector(state)
|
||||||
|
|
||||||
const {
|
|
||||||
identities,
|
|
||||||
address,
|
|
||||||
keyrings,
|
|
||||||
isInitialized,
|
|
||||||
unapprovedTxs,
|
|
||||||
lostAccounts,
|
|
||||||
unapprovedMsgCount,
|
|
||||||
unapprovedPersonalMsgCount,
|
|
||||||
unapprovedTypedMessagesCount,
|
|
||||||
providerRequests,
|
|
||||||
} = metamask
|
|
||||||
const selected = address || Object.keys(accounts)[0]
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// state from plugin
|
// state from plugin
|
||||||
networkDropdownOpen,
|
|
||||||
sidebar,
|
sidebar,
|
||||||
alertOpen,
|
alertOpen,
|
||||||
alertMessage,
|
alertMessage,
|
||||||
isLoading,
|
isLoading,
|
||||||
loadingMessage,
|
loadingMessage,
|
||||||
isInitialized,
|
|
||||||
isUnlocked: state.metamask.isUnlocked,
|
isUnlocked: state.metamask.isUnlocked,
|
||||||
selectedAddress: state.metamask.selectedAddress,
|
|
||||||
currentView: state.appState.currentView,
|
currentView: state.appState.currentView,
|
||||||
activeAddress: state.appState.activeAddress,
|
|
||||||
transForward: state.appState.transForward,
|
|
||||||
isOnboarding: Boolean(!isInitialized),
|
|
||||||
isPopup: state.metamask.isPopup,
|
|
||||||
submittedPendingTransactions: submittedPendingTransactionsSelector(state),
|
submittedPendingTransactions: submittedPendingTransactionsSelector(state),
|
||||||
unapprovedTxs,
|
|
||||||
unapprovedMsgs: state.metamask.unapprovedMsgs,
|
|
||||||
unapprovedMsgCount,
|
|
||||||
unapprovedPersonalMsgCount,
|
|
||||||
unapprovedTypedMessagesCount,
|
|
||||||
menuOpen: state.appState.menuOpen,
|
|
||||||
network: state.metamask.network,
|
network: state.metamask.network,
|
||||||
provider: state.metamask.provider,
|
provider: state.metamask.provider,
|
||||||
forgottenPassword: state.appState.forgottenPassword,
|
|
||||||
lostAccounts,
|
|
||||||
frequentRpcListDetail: state.metamask.frequentRpcListDetail || [],
|
frequentRpcListDetail: state.metamask.frequentRpcListDetail || [],
|
||||||
currentCurrency: state.metamask.currentCurrency,
|
currentCurrency: state.metamask.currentCurrency,
|
||||||
isMouseUser: state.appState.isMouseUser,
|
isMouseUser: state.appState.isMouseUser,
|
||||||
Qr: state.appState.Qr,
|
|
||||||
welcomeScreenSeen: state.metamask.welcomeScreenSeen,
|
|
||||||
providerId: getNetworkIdentifier(state),
|
providerId: getNetworkIdentifier(state),
|
||||||
autoLogoutTimeLimit,
|
autoLogoutTimeLimit,
|
||||||
|
providerRequests: metamask.providerRequests,
|
||||||
// state needed to get account dropdown temporarily rendering from app bar
|
|
||||||
identities,
|
|
||||||
selected,
|
|
||||||
keyrings,
|
|
||||||
providerRequests,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function mapDispatchToProps (dispatch) {
|
function mapDispatchToProps (dispatch) {
|
||||||
return {
|
return {
|
||||||
dispatch,
|
lockMetaMask: () => dispatch(actions.lockMetamask(false)),
|
||||||
hideSidebar: () => dispatch(actions.hideSidebar()),
|
hideSidebar: () => dispatch(actions.hideSidebar()),
|
||||||
showNetworkDropdown: () => dispatch(actions.showNetworkDropdown()),
|
|
||||||
hideNetworkDropdown: () => dispatch(actions.hideNetworkDropdown()),
|
|
||||||
setCurrentCurrencyToUSD: () => dispatch(actions.setCurrentCurrency('usd')),
|
setCurrentCurrencyToUSD: () => dispatch(actions.setCurrentCurrency('usd')),
|
||||||
toggleAccountMenu: () => dispatch(actions.toggleAccountMenu()),
|
|
||||||
setMouseUserState: (isMouseUser) => dispatch(actions.setMouseUserState(isMouseUser)),
|
setMouseUserState: (isMouseUser) => dispatch(actions.setMouseUserState(isMouseUser)),
|
||||||
setLastActiveTime: () => dispatch(actions.setLastActiveTime()),
|
setLastActiveTime: () => dispatch(actions.setLastActiveTime()),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user