diff --git a/react/src/components/dashboard/navbar/navbar.js b/react/src/components/dashboard/navbar/navbar.js index a5e9042..ec62a38 100755 --- a/react/src/components/dashboard/navbar/navbar.js +++ b/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, + }, }; }; diff --git a/react/src/components/dashboard/navbar/navbar.render.js b/react/src/components/dashboard/navbar/navbar.render.js index fca2a46..6a8bb05 100644 --- a/react/src/components/dashboard/navbar/navbar.render.js +++ b/react/src/components/dashboard/navbar/navbar.render.js @@ -109,6 +109,22 @@ const NavbarRender = function() { { translate('ABOUT.ABOUT_AGAMA') } + { this.props.Main && + this.props.Main.isLoggedIn && +