Merge pull request #2287 from isocolsky/checksum_close
Add checksum when signing out
This commit is contained in:
commit
9ff600ba49
2 changed files with 22 additions and 9 deletions
|
|
@ -460,9 +460,26 @@ Identity.prototype._cleanUp = function() {
|
||||||
/**
|
/**
|
||||||
* @desc Closes the wallet and disconnects all services
|
* @desc Closes the wallet and disconnects all services
|
||||||
*/
|
*/
|
||||||
Identity.prototype.close = function() {
|
Identity.prototype.close = function(cb) {
|
||||||
this._cleanUp();
|
var self = this;
|
||||||
this.emitAndKeepAlive('closed');
|
|
||||||
|
function doClose() {
|
||||||
|
self._cleanUp();
|
||||||
|
self.emitAndKeepAlive('closed');
|
||||||
|
if (cb) return cb();
|
||||||
|
};
|
||||||
|
|
||||||
|
self.verifyChecksum(function(err, match) {
|
||||||
|
if (!err && match) {
|
||||||
|
self.store({
|
||||||
|
noWallets: true,
|
||||||
|
}, function(err) {
|
||||||
|
return doClose();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return doClose();
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -322,12 +322,8 @@ angular.module('copayApp.services')
|
||||||
root.signout = function() {
|
root.signout = function() {
|
||||||
$rootScope.signingOut = true;
|
$rootScope.signingOut = true;
|
||||||
if ($rootScope.iden) {
|
if ($rootScope.iden) {
|
||||||
$rootScope.iden.store({
|
$rootScope.signingOut = false;
|
||||||
noWallets: true
|
$rootScope.iden.close(); // Will trigger 'closed'
|
||||||
}, function() {
|
|
||||||
$rootScope.signingOut = false;
|
|
||||||
$rootScope.iden.close(); // Will trigger 'closed'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue