fix Identity
This commit is contained in:
parent
30a6109abf
commit
cac407c827
1 changed files with 5 additions and 5 deletions
|
|
@ -125,7 +125,7 @@ Identity.open = function(opts, cb) {
|
||||||
|
|
||||||
var storage = opts.storage || opts.pluginManager.get('DB');
|
var storage = opts.storage || opts.pluginManager.get('DB');
|
||||||
storage.setCredentials(opts.email, opts.password, opts);
|
storage.setCredentials(opts.email, opts.password, opts);
|
||||||
storage.getItem(Identity.getKeyForEmail(opts.email), function(err, data) {
|
storage.getItem(Identity.getKeyForEmail(opts.email), function(err, data, headers) {
|
||||||
var exported;
|
var exported;
|
||||||
if (err) {
|
if (err) {
|
||||||
return cb(err);
|
return cb(err);
|
||||||
|
|
@ -135,7 +135,7 @@ Identity.open = function(opts, cb) {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return cb(e);
|
return cb(e);
|
||||||
}
|
}
|
||||||
return cb(null, new Identity(_.extend(opts, exported)));
|
return cb(null, new Identity(_.extend(opts, exported)), headers);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -577,6 +577,7 @@ Identity.prototype.createWallet = function(opts, cb) {
|
||||||
self.wallets[w.getId()] = w;
|
self.wallets[w.getId()] = w;
|
||||||
self.updateFocusedTimestamp(w.getId());
|
self.updateFocusedTimestamp(w.getId());
|
||||||
self.bindWallet(w);
|
self.bindWallet(w);
|
||||||
|
self.updateFocusedTimestamp(w.getId());
|
||||||
self.storeWallet(w, function(err) {
|
self.storeWallet(w, function(err) {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
|
|
||||||
|
|
@ -643,11 +644,10 @@ Identity.prototype.deleteWallet = function(walletId, cb) {
|
||||||
delete this.focusedTimestamps[walletId];
|
delete this.focusedTimestamps[walletId];
|
||||||
|
|
||||||
this.storage.removeItem(Wallet.getStorageKey(walletId), function(err) {
|
this.storage.removeItem(Wallet.getStorageKey(walletId), function(err) {
|
||||||
if (err) {
|
if (err) return cb(err);
|
||||||
return cb(err);
|
|
||||||
}
|
|
||||||
self.emitAndKeepAlive('deletedWallet', walletId);
|
self.emitAndKeepAlive('deletedWallet', walletId);
|
||||||
self.store(null, cb);
|
self.store(null, cb);
|
||||||
|
return cb();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue