Merge pull request #1913 from matiu/feature/quota

Feature/quota
This commit is contained in:
Gustavo Maximiliano Cortez 2014-12-02 09:46:11 -03:00
commit 17614d2968
13 changed files with 162 additions and 32 deletions

View file

@ -122,7 +122,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) {
storage.getItem(Identity.getKeyForEmail(opts.email), function(err, data, headers) {
var exported;
if (err) {
return cb(err);
@ -132,7 +132,7 @@ Identity.open = function(opts, cb) {
} catch (e) {
return cb(e);
}
return cb(null, new Identity(_.extend(opts, exported)));
return cb(null, new Identity(_.extend(opts, exported)), headers);
});
};
@ -619,11 +619,10 @@ 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();
});
};