Browse Source

spv lock, logout

v0.25
pbca26 7 years ago
parent
commit
277d3fd021
  1. 25
      react/src/components/dashboard/navbar/navbar.js
  2. 16
      react/src/components/dashboard/navbar/navbar.render.js

25
react/src/components/dashboard/navbar/navbar.js

@ -6,6 +6,10 @@ import {
stopInterval,
startInterval,
displayImportKeyModal,
shepherdElectrumLock,
shepherdElectrumLogout,
getDexCoins,
activeHandle,
} from '../../../actions/actionCreators';
import Store from '../../../store';
import Config from '../../../config';
@ -23,6 +27,24 @@ class Navbar extends React.Component {
this.openDropMenu = this.openDropMenu.bind(this);
this.handleClickOutside = this.handleClickOutside.bind(this);
this._checkAC = this._checkAC.bind(this);
this.spvLock = this.spvLock.bind(this);
this.spvLogout = this.spvLogout.bind(this);
}
spvLock() {
shepherdElectrumLock()
.then((res) => {
Store.dispatch(getDexCoins());
Store.dispatch(activeHandle());
});
}
spvLogout() {
shepherdElectrumLogout()
.then((res) => {
Store.dispatch(getDexCoins());
Store.dispatch(activeHandle());
});
}
componentWillMount() {
@ -106,6 +128,9 @@ const mapStateToProps = (state) => {
Interval: {
interval: state.Interval.interval,
},
Main: {
isLoggedIn: state.Main.isLoggedIn,
},
};
};

16
react/src/components/dashboard/navbar/navbar.render.js

@ -109,6 +109,22 @@ const NavbarRender = function() {
<i className="icon fa-users"></i> { translate('ABOUT.ABOUT_AGAMA') }
</a>
</li>
{ this.props.Main &&
this.props.Main.isLoggedIn &&
<li>
<a onClick={ this.spvLock }>
<i className="icon fa-lock"></i> Lock
</a>
</li>
}
{ this.props.Main &&
this.props.Main.isLoggedIn &&
<li>
<a onClick={ this.spvLogout }>
<i className="icon fa-power-off"></i> Logout
</a>
</li>
}
</ul>
</li>
</ul>

Loading…
Cancel
Save