Added lastOpened to list of all wallets
This commit is contained in:
parent
be72a2b77a
commit
cfa00590a6
3 changed files with 45 additions and 13 deletions
|
|
@ -368,11 +368,19 @@ WalletFactory.prototype.open = function(walletId, passphrase, cb) {
|
|||
};
|
||||
|
||||
WalletFactory.prototype.getWallets = function(cb) {
|
||||
this.storage.getWallets(function(ret) {
|
||||
ret.forEach(function(i) {
|
||||
var self = this;
|
||||
this.storage.getWallets(function(wallets) {
|
||||
wallets.forEach(function(i) {
|
||||
i.show = i.name ? ((i.name + ' <' + i.id + '>')) : i.id;
|
||||
});
|
||||
return cb(null, ret);
|
||||
self.storage.getLastOpened(function(lastId) {
|
||||
var last = _.findWhere(wallets, {
|
||||
id: lastId
|
||||
});
|
||||
if (last)
|
||||
last.lastOpened = true;
|
||||
return cb(null, wallets);
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue