mirror of https://github.com/BTCPrivate/copay.git
add checksum on close
This commit is contained in:
parent
a8923d2a69
commit
5255d4ba31
|
@ -460,9 +460,26 @@ Identity.prototype._cleanUp = function() {
|
|||
/**
|
||||
* @desc Closes the wallet and disconnects all services
|
||||
*/
|
||||
Identity.prototype.close = function() {
|
||||
this._cleanUp();
|
||||
this.emitAndKeepAlive('closed');
|
||||
Identity.prototype.close = function(cb) {
|
||||
var self = this;
|
||||
|
||||
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() {
|
||||
$rootScope.signingOut = true;
|
||||
if ($rootScope.iden) {
|
||||
$rootScope.iden.store({
|
||||
noWallets: true
|
||||
}, function() {
|
||||
$rootScope.signingOut = false;
|
||||
$rootScope.iden.close(); // Will trigger 'closed'
|
||||
});
|
||||
$rootScope.signingOut = false;
|
||||
$rootScope.iden.close(); // Will trigger 'closed'
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue