mirror of https://github.com/BTCPrivate/copay.git
fix signout
This commit is contained in:
parent
f208e1fc7b
commit
5fc4ab5101
|
@ -18,7 +18,7 @@
|
||||||
</figure>
|
</figure>
|
||||||
<div class="text-right" ng-show="$root.wallet">
|
<div class="text-right" ng-show="$root.wallet">
|
||||||
<div ng-if="$root.wallet.name">
|
<div ng-if="$root.wallet.name">
|
||||||
<h5>Wallet: escape({{$root.wallet.name}}) <{{$root.wallet.id}}></h5>
|
<h5>Wallet: {{$root.wallet.name}} <{{$root.wallet.id}}></h5>
|
||||||
<p>
|
<p>
|
||||||
</div>
|
</div>
|
||||||
<div ng-if="!$root.wallet.name && $root.wallet.id">
|
<div ng-if="!$root.wallet.name && $root.wallet.id">
|
||||||
|
|
|
@ -258,8 +258,8 @@ Network.prototype._setupPeerHandlers = function(openCallback) {
|
||||||
self._checkAnyPeer();
|
self._checkAnyPeer();
|
||||||
});
|
});
|
||||||
|
|
||||||
p.on('connection', function(dataConn) {
|
|
||||||
|
|
||||||
|
p.on('connection', function(dataConn) {
|
||||||
console.log('### NEW INBOUND CONNECTION %d/%d', self.connectedPeers.length, self.maxPeers);
|
console.log('### NEW INBOUND CONNECTION %d/%d', self.connectedPeers.length, self.maxPeers);
|
||||||
if (self.connectedPeers.length >= self.maxPeers) {
|
if (self.connectedPeers.length >= self.maxPeers) {
|
||||||
console.log('### PEER REJECTED. PEER MAX LIMIT REACHED');
|
console.log('### PEER REJECTED. PEER MAX LIMIT REACHED');
|
||||||
|
@ -403,6 +403,7 @@ Network.prototype.connectTo = function(copayerId) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Network.prototype._cleanUp = function() {
|
Network.prototype._cleanUp = function() {
|
||||||
|
var self = this;
|
||||||
self.connectedPeers = [];
|
self.connectedPeers = [];
|
||||||
self.started = false;
|
self.started = false;
|
||||||
self.peerId = null;
|
self.peerId = null;
|
||||||
|
@ -421,9 +422,10 @@ Network.prototype._cleanUp = function() {
|
||||||
Network.prototype.disconnect = function(cb, forced) {
|
Network.prototype.disconnect = function(cb, forced) {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.closing = 1;
|
self.closing = 1;
|
||||||
this.send(null, { type: 'disconnect' });
|
self.send(null, { type: 'disconnect' }, function(){
|
||||||
this._cleanUp();
|
self._cleanUp();
|
||||||
if (typeof cb === 'function') cb();
|
if (typeof cb === 'function') cb();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = require('soop')(Network);
|
module.exports = require('soop')(Network);
|
||||||
|
|
|
@ -4,6 +4,8 @@ angular.module('copay.controllerUtils').factory('controllerUtils', function ($ro
|
||||||
var root = {};
|
var root = {};
|
||||||
|
|
||||||
root.logout = function() {
|
root.logout = function() {
|
||||||
|
console.log('### DELETING WALLET'); //TODO
|
||||||
|
$rootScope.wallet = null;
|
||||||
delete $rootScope['wallet'];
|
delete $rootScope['wallet'];
|
||||||
$rootScope.totalBalance = 0;
|
$rootScope.totalBalance = 0;
|
||||||
$location.path('signin');
|
$location.path('signin');
|
||||||
|
|
Loading…
Reference in New Issue