add warning for old wallets

This commit is contained in:
Matias Alejo Garcia 2014-10-11 14:33:45 -03:00
commit 29bbfa184c
9 changed files with 8 additions and 48 deletions

View file

@ -45,8 +45,8 @@ Profile.create = function(email, password, storage, cb) {
Profile.any = function(storage, cb) {
storage.getFirst(Profile.key(''), function(err, val) {
return cb(val ? true : false);
storage.getFirst(Profile.key(''), function(err, v, k) {
return cb(k ? true : false);
});
};

View file

@ -163,7 +163,7 @@ Storage.prototype.getFirst = function(prefix, cb) {
});
if (keys.length === 0) return cb(new Error('not found'));
self._read(keys[0], function(v) {
if (_.isNull(v)) return cb(new Error('Could not decrypt data'));
if (_.isNull(v)) return cb(new Error('Could not decrypt data'), null, keys[0]);
return cb(null, v, keys[0]);
})
});

View file

@ -174,8 +174,8 @@ Wallet.key = function(str) {
Wallet.any = function(storage, cb) {
storage.getFirst(Wallet.key(''), function(err, val) {
return cb(val ? true : false);
storage.getFirst(Wallet.key(''), function(err, v, k) {
return cb(k ? true : false);
});
};