mv log to util

This commit is contained in:
Matias Alejo Garcia 2014-12-02 11:17:03 -03:00
commit 30a6109abf
8 changed files with 96 additions and 4 deletions

View file

@ -125,7 +125,7 @@ Identity.open = function(opts, cb) {
var storage = opts.storage || opts.pluginManager.get('DB');
storage.setCredentials(opts.email, opts.password, opts);
storage.getItem(Identity.getKeyForEmail(opts.email), function(err, data, headers) {
storage.getItem(Identity.getKeyForEmail(opts.email), function(err, data) {
var exported;
if (err) {
return cb(err);
@ -135,7 +135,7 @@ Identity.open = function(opts, cb) {
} catch (e) {
return cb(e);
}
return cb(null, new Identity(_.extend(opts, exported)), headers);
return cb(null, new Identity(_.extend(opts, exported)));
});
};
@ -643,10 +643,11 @@ Identity.prototype.deleteWallet = function(walletId, cb) {
delete this.focusedTimestamps[walletId];
this.storage.removeItem(Wallet.getStorageKey(walletId), function(err) {
if (err) return cb(err);
if (err) {
return cb(err);
}
self.emitAndKeepAlive('deletedWallet', walletId);
self.store(null, cb);
return cb();
});
};