1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix Import Account link not hiding sidebar

This commit is contained in:
Alexander Tseung 2017-10-16 01:27:51 -04:00 committed by Chi Kei Chan
parent a9244f5e42
commit 7caa914223
2 changed files with 9 additions and 3 deletions

View File

@ -164,7 +164,7 @@ class AccountDropdowns extends Component {
} }
renderAccountSelector () { renderAccountSelector () {
const { actions, useCssTransition, innerStyle } = this.props const { actions, useCssTransition, innerStyle, sidebarOpen } = this.props
const { accountSelectorActive, menuItemStyles } = this.state const { accountSelectorActive, menuItemStyles } = this.state
return h( return h(
@ -223,7 +223,11 @@ class AccountDropdowns extends Component {
h( h(
DropdownMenuItem, DropdownMenuItem,
{ {
closeMenu: () => {}, closeMenu: () => {
if (sidebarOpen) {
actions.hideSidebar()
}
},
onClick: () => actions.showImportPage(), onClick: () => actions.showImportPage(),
style: Object.assign( style: Object.assign(
{}, {},
@ -457,6 +461,7 @@ const mapDispatchToProps = (dispatch) => {
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {
keyrings: state.metamask.keyrings, keyrings: state.metamask.keyrings,
sidebarOpen: state.appState.sidebarOpen,
} }
} }

View File

@ -45,8 +45,9 @@ WalletView.prototype.renderWalletBalance = function () {
selectedAccount, selectedAccount,
unsetSelectedToken, unsetSelectedToken,
hideSidebar, hideSidebar,
sidebarOpen sidebarOpen,
} = this.props } = this.props
const selectedClass = selectedTokenAddress const selectedClass = selectedTokenAddress
? '' ? ''
: 'wallet-balance-wrapper--active' : 'wallet-balance-wrapper--active'